[p4] Tracking renames across branches

Marc Chung mchung at gmail.com
Sat Aug 18 13:01:46 PDT 2007


The gist of my question:

I have identical branches, //depot/foo and //depot/mchung/foo-mvn.
Files in foo-mvn have been moved around.  During an integration, if a
file in the foo branch has been modified, how do I instruct Perforce
to observe the move and correctly integrate with the file in foo-mvn?

The much longer write up:

I have a branch, //depot/foo, that contains multiple Java and C++
projects.  My task is to migrate the existing build system, for the
Java artifacts, over to Maven.

Here's what I've done:

1. Create a label, foo001, and apply it to the files in //depot/foo
2. Create a new branch //depot/mchung/foo-mvn integrating from
//depot/foo/... at foo001
3. Refactor Java projects; move lots of files around
4. Periodically, I'll integrate from //depot/foo/... to
//depot/mchung/foo-mvn.  Often a modified file doesn't exist in
foo-mvn at the same location.

For instance, Superman.java:

 Superman.java is originally located in:
   //depot/foo/heroes/javasrc/com/heroes/Superman.java

 But in my private branch has been renamed to:
   //depot/mchung/foo-mvn/heroes/src/main/java/com/heroes/Superman.java

5. To integrate, I'm doing:
   a. Create label foo002 and labeling //depot/foo/...
   a. Integrate from //depot/foo/... at foo001, at foo002 to
//depot/mchung/foo-mvn/...
   b. Submit change list, temporarily breaking the branch.
   c. Quickly integrate the updated files into their updated
locations, _one by one_!

Even with a small set of changes, this can be very painful.

Some thoughts:

1. In step c), I've tried renaming the files, but I'm pretty sure I
had to issue a delete to avoid a conflict.

2. There's a recent post (2006-July) that pretty much describes what
I'm doing here
    http://maillist.perforce.com/pipermail/perforce-user/2006-July/019336.html

3. I've read AntonPaper.pdf, and I got the impression that renaming
files across branches was possible through indirect integrations.  Am
I doing something incorrectly?

Thanks for your time.

-Marc Chung



More information about the perforce-user mailing list