Pregunta

I have get this issue: There are two branches, both have been changed and not been submit.Named Project-A and Project-B; Now, I want to merge/integrate A to B. I have some ideas to do this.

  1. Build a new branch and merge the older two.

    • build a new branch named Project-C
    • submit Project A; So I can check out A to C (copy A to C)
    • within C, use p4 integrate B; then A is integrated to B
  2. Use changelist to integrate since Perforce use changelist(submit | shelve) for managing.

    • get newest changelist of A
    • within B, use p4 integrate A; now B is merged with the head version in depot
    • copy the changlist of A to B; so B can update with the change in A.
    • submit B
  3. Use diff & patch

    • diff A to the version in depot
    • patch to B

I am a nieb of Perforce, so there will be some mistakes of the description. The three ideas haven't tested yet because I am afraid to break the branches of my team.

So, my problem is : Will one of the three solutions work? & Which one will be the best?

Thanks very much.

Cheers.

¿Fue útil?

Solución

With the 2013.1 version of the Perforce server, you can unshelve through a branch spec, so the process for doing this is:

  1. Shelve the changes for project A
  2. Shelve the changes for project B (optional)
  3. Create a branch view which maps project A to project B
  4. Unshelve the shelf from step 1, using the branch view from step 3, into the workspace which has the project B files open.

The Server will schedule integrations and merges of the shelved content from step (1) against the opened files in the project B workspace.

After resolving the integration merges, you can diff all the changes and either proceed with them or make further changes.

The reason for shelving the changes for project B in step (2) is so that if you don't like the results of the integration and merge, you can revert everything and re-start the process from the shelved work.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top