views:

28

answers:

2

I'm using perforce for versioning control. Let's say I am working on a file in the main branch:
//main/xx.cs (it's open for edit)

In the mean time, //main gets branched to //v1 and then //main gets locked. Is there a way I can integrate my local changes in //main/xx.cs directly to //v1/xx.cs ?

A: 

Here's one possibility...

  • Sync //main to the changelist where the branch was made. Resolve conflicts.
  • Important! Sync //v1 to the same changelist.
  • Open //v1/xx.cs for edit.
  • The ugly part: manually copy the local copy of //main/xx.cs over the local copy of //v1/xx.cs
  • Sync //v1 to head and resolve conflicts.
  • Submit changes.

Voila!

Cristi Diaconescu
+1  A: 

There's a similar question: http://stackoverflow.com/questions/300160/can-i-integrate-checked-out-files-into-a-different-branch-on-perforce

One of the answers there gives:
http://kb.perforce.com/UserTasks/CodelinesAndBranching/BranchingWorkInProgress which looks like it will provide more than you need.

There is also various p4shelve, p4tar options that might help:

  1. P4 Shelve Python addition for any version of Perforce
  2. P4tar offline (or at least off-server) saving of changes
  3. p4 shelve 2009.2 and later Perforce feature to provide built-in shelving.
Douglas Leeder
Wow! P4 has learned 'shelve'!
Cristi Diaconescu