Perforce to ignore revision during integrations - perforce

I have created feature branch for one of our projects, and deleted all documentation files there in one changelist. (I know, bad idea).
I want to integrate back everything except given changelist, I tried following to ignore it:
p4 integrate //branch/...#CL,CL //main/...
p4 resolve -at //main/...
However, the files still remain marked for deletion - the resolve ends with
//main/... - no file(s) to resolver.
Is there any way how to tell perforce that given CL is already integrated and ignore it in subsequent integrations?

Note that you need at least a 2011.1 server to do this (if your server is older you'll get an error message on the integrate):
p4 integrate -Rd //branch/...#CL,CL //main/...
p4 resolve -ay
The "-Rd" flag says that files which would normally be opened for delete automatically should be opened for integrate and scheduled for resolve instead. In turn, the "p4 resolve -ay" will say that you want to keep what's in your workspace (an "integrate" with no content change) and submit that as the final result.
The submitted "integrate" revisions will record that you have done this integration (the history will show an "ignore" of the deleted revisions in your branch), but without actually changing the contents of the submitted files.
If you use the "p4 merge" command instead of the "p4 integrate" command (with a more current server version, I think 2013.1 or thereabouts), all files are scheduled for resolve automatically (i.e. including those that would previously have been automatically opened for branch or delete), so with "p4 merge" you always must resolve (and may optionally ignore) any source change.
Relevant p4 blog entries:
http://www.perforce.com/blog/110620/ignoring-branches-deletes
http://www.perforce.com/blog/130812/resolve-face-adversity

It seems like you wanted 'resolve -ay' here, not 'resolve -at'. When integrating back to main, I think that "theirs" is the branch, while "yours" is main.
From 'p4 help resolve':
The resolve process is a classic three-way merge. The participating
files are referred to as follows:
'yours' The target file open in the client workspace
'theirs' The source file in the depot
'base' The common ancestor; the highest revision of the
source file already accounted for in the target.
'merged' The merged result.
Filenames, filetypes, and text file content can be resolved by
accepting 'yours', 'theirs', or 'merged'. Branching, deletion, and
binary file content can be resolved by accepting either 'yours' or
'theirs'.

Related

How to re-add deleted files as result of backout operation in Perfroce?

I had submitted a change-list containing some new files and then for some reason had to back-out.
Now I am trying to submit a new change-list that adds the same file back.
The problem is that when I backed-out, it deleted those files from HEAD revision and now when I am trying to submit my change-list it says 'Out of date files must be resolved or reverted'
I tried googling the solution but could not find anything relevant, can somebody please guide me right direction?
You just need to back out the first back-out. (When you say you backed out the addition, you mean you also submitted it, right?)
Locate the changelist that you submitted, e.g. via P4V's Submitted tab, right-click and choose Back Out....
It's best if the files you're trying to resurrect (re-add) don't already exist on your filesystem, otherwise Perforce will refuse to overwrite them. (Which may be what the error message is telling you; I'm not sure.)

Overwrite from branch

I have two branches _trunk and _dev.
There is a folder (actually it's config) where intensive work is performed in both branches.
Now I need to merge from _trunk to _dev. But I need to merge only the code.
The config should be REPLACED. I'm not sure that replacing it manually is right way. How this operation is called? How do you do similair things?
It's an integration as usual, but during resolve you'll accept the source files without trying to merge them into the destination. This will replace the destination files' content with the source content.
Edit: If there are adds and deletes in the source, make sure you let Perforce propagate those with the appropriate options checked.
You can do an "Integrate/Merge" from _trunk to _dev. Any conflicts will set up in your pending changelist as a "Resolve" for each file.
For code you can let P4V attempt to merge it for you and make changes / do the merge manually. For the config files, in the resolve window do "Accept Source" - this overrides the target with the source regardless.
Likewise, if there's any where you know you don't want to bring your changes forward but still want it to recognise you've checked and accomodated for the changes, use "Accept Target"

Error in p4 submit of a file in a branch

I have a question about p4 submit.
At work I have created a branch in perforce, and branched out from a main codeline(mainline) and got the latest revisions of all the files of a certain folder say folder1, from the depot into my workspace.
Now I changed a file inside folder1, say file.cpp. So I first Checked out that file from that branch into my workspace.
Now I wanted to submit this version to depot as next revision in the branch codeline (Not mainline - NO Integration intended, just want to create next revision of that file in my branch and submit to depot)
I use p4 visual client. When I right click on this changed file, file.cpp and say submit that file alone, it gave mer error:
verify job validation failed: MISSING JOB.
Job needs to be associated with change.
Question: How does one create this association between job and change.
What is to be done to fix this error and submit my file to create its next revision in the branch?
Well after another agonising trial and errors, found what i was doing wrong:
After we say file.cpp context Right Click, Submit, One has to create a new job.
In the window that comes up, enter description of job , username. When job is created successfully. it would say something like job5436060
Then control comes back to previous iwndow submit file. There add this job.
Earlier I was adding just the numerical part of job i.e. 5436060 , which lead to errors of job not found and it threw me offtrack completely.
What we need to enter while adding a job is job5436060 Now it will find the job, add successfully that job and then the submit command was successfull.
:-) Little joys you have, after anguishing over something you think should be straightforward but struggle after you miss something simple but fundamental.
Your perforce server must have a pre-submit trigger set up which requires a job with every submitted changeset. You'll have to (create and) add a job to the pending changeset before you submit it successfully.

Instancing files in Perforce across multiple locations

Maybe some Perforce gurus could provide some advice.
We have a depot, with a setting.xml file in central folder:
///depot/central/config/setting.xml
and would like it to be instanced in several locations, like:
///depot/projectA/tool1/config/setting.xml
///depot/customerB/tool2/config/setting.xml
The benefit is for maintenance. the setting.xml file only has to be updated once in //depot/central, then all files in the other places get updated as well, so we don't have to get into each place, duplicate it again and again.
AlienBrain has a feature called 'shortcuts', does Perforce have something similar?
We've tried use the OS' symbolic links feature, but it didn't behave the way expected -- cloned files still need to be checked-out first, then check them in again -- this makes the cloned files own their own revisions against the original one.
It's better to just keep the original and cloned files have the same revisions. so if submitting a new revision to setting.xml(5/5)(which makes it to be setting.xml(6/6)), the cloned files as this point still remains setting.xml(5/6). Thus, people on projectA & customerB can simply sync to the latest version.
Thanks.
You can use the Perforce client spec to map files from the depot into your workspaces, which should do almost exactly what you're looking for.
For example, your client spec for tool 1 would be something like:
//depot/projectA/tool1/... //workspace_for_tool1/...
//depot/central/config/setting.xml //workspace_for_tool1/config/setting.xml
And your client spec for tool 2 would be something like:
//depot/customerB/tool2/... //workspace_for_tool2/...
//depot/central/config/setting.xml //workspace_for_tool2/config/setting.xml
The main downside of this approach is that you need to make this change in every client spec, and you need some infrastructure dedicated to propagating client specs to new workspaces.

Cannot integrate change using perforce

I am trying to integrate a change list from one branch of code to another branch.For this I do
1)p4 integ old_branch#cl,cl new_branch
2)p4 resolve -am
3)p4 change.
Now when I am doing the last part(p4 change ) I see this error :-
The document “tmp.BLAH BLAH” could not be opened. You don’t have
permission.
Has anyone seen this before and can help me correct this?I do have the config file under the branch's root
I was using P4V with Perforce when I had to use it. Drastically helped me with merges considering P4 is not quite like using SVN or Git.
Also I think that if the file can be removed from your filesystem you can revert to the latest from the repository if in fact it is a file from the repository. Then you can retry your merge.
I know in other merge programs the tmp files are generated during the conflict resolution process so you may be facing a similar issue.

Resources