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.
Related
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.)
The Scenario
I want to rollback a changeset.
The Problem
When I perform Rollback Entire Changeset from my $/SAM/Main branch using the VS2012 IDE, the Resolve Conflicts tab displays, and ALL of the files I'm trying to rollback have the following message associated with them:
The item being rolled back has changed in a later version
Changes being rolled back: 54460~54460 Your workspace version is: 54460
You have a pending change on the item
At this point, the only option available to me in the Resolve Conflicts tab is an Undo Rollback button.
Things to Note
CS54460 was created using the following command line:
merge $/SAM/Dev $/SAM/Main /discard /recursive /version:C54426~C54426
CS54460, when viewing the Changeset Details, performs a [merge, branch, delete] on ALL the files.
Why I Need to Do This
I need to do this, because I need to merge CS54426 from the $/SAM/Dev branch up to the $/SAM/Main branch.
Don't use rollback, just do it manually:
get the version you want to roll back to
back up the changed files
check out the changed files. If you're lucky the old code will be preserved but the checkout may force you back to the newest version.
so if necessary copy the backups over the master source files again
test and check in
My problem was solved by using the following command:
merge $/SAM/Dev $/SAM/Main /recursive **/force** /version:C54426~C54426
This forced the changeset I needed in $/SAM/Dev to disregard the "Keep Yours" changeset in $/SAM/Main, thus merging the code I needed up to the $/SAM/Main branch.
I was getting the error "TF203051: Cannot rollback item XYZ because the workspace version of the item is at or older than the version to which you are trying to rollback to. Update the version in your workspace to a newer version than the version to which you are trying to rollback to and then retry your operation." when attempting to roll back to a specific version in the history in VS2017.
The problem was that file XYZ, one of the files was included in multiple changesets, a second one was more recent than the one I was trying to roll back.
Luckily I needed to roll back that too. So the solution was to roll back both versions at the same time by selecting them together in the history view of Source Control Explorer.
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'.
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.
I have a repository that has the following directories:
branches
tags
trunk
The trunk directory contains the main line of development. I have created a post-commit hook script for the repository that updates a working copy (of trunk) when a user commits back to repository.
It looks something like this:
/usr/bin/svn update /path/to/a/working/copy
I've just created a branch of the code as I'm about to start some major changes but noticed that when I commit my changes to branch it calls the post-commit hook and updates the working copy (copy of trunk).
Is there a way I can modify either my post-commit hook script or a setting that I can make that would only update the working copy if the commit was made to the trunk directory and not any other directory?
As you can see in this documentation, parameters are passed to the post-commit script.
The repository passes two arguments to this program: the path to the repository, and the new revision number that was created.
The post-commit hook could be any program of any type : a bash script, a C program, a python script...What happens is that the shell launches this program, with the two parameters.
You can find a list of interesting scripts here. A good beginning would be this python script, which uses the python svn libs.
Please note that the path provided is not the same as the path to the file that you are checking in (see Paul's answer). But using this information with the revnum should help you to get the list of the changes, from which you can determine if operations have been done on trunk or not.
In addition to the answer from Bishiboosh, it is worth noting that the hooks can be any program. That is, if you wanted to, you could write the program in C. The parameters that are passed are described in the doc.
For a good repository of scripts to get inspiration from, have a look at the subversion tools page. In general, if you want to do some conditional processing based on the contents of the transaction, and you do, since you only want to process if the files are in trunk, then it will be easiest to use Python, since that comes with a bunch of tools to examine the transactions. This script is a good place to start looking for inspiration.
Note, that the path to the parameter, is not the same as the path to the file that you are checking in. You could have multiple files in the checkin after all… What you are passed is the location of the repository, and the revision of the change. Using these two pieces of information you can get the information about the change from the repository, and use that information to decide whether to perform an action or not in the post-commit hook.
Here is another example (in Perl) That explicitly checks the path of the files in the checkin. This is a much more complicated script, but most likely the salient parts can be ripped out and re-used.