Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perforce: How do I p4 integrate a local uncommitted changelist?

Tags:

Here's my scenario:

I have two projects projectA and projectB. A branchspec auto-integrates projectA to projectB. Now, I have a changelist which modifies some files in projectA -- I have not committed/submitted this changelist yet.

I'd like this changelist to go into projectB only.

Doing a p4 integrate -b branchspec -c changelistNumber

shows

"All revision(s) are integrated."

How can I integrate an uncommitted changelist?

like image 754
Debajit Avatar asked Mar 18 '10 18:03

Debajit


2 Answers

Perforce has a much easier way of accomplishing this:

  1. Shelve your changelist on branchA (note the changelist #, we'll call it NUM for reference here)

  2. Create a branch mapping between branchA and branchB (we'll call it A_to_B)

  3. Run the following command:

    p4 unshelve -s NUM -b A_to_B
    
like image 70
Guy Danus Avatar answered Oct 20 '22 12:10

Guy Danus


Hack-ish solution:

  1. Check out the files in project B
  2. Manually copy files from project A to project B (they're not write-protected due to step 1)
  3. Shelve changelist in project A
  4. Submit to B
  5. Integrate files from B to A and resolve
  6. Unshelve files from step 3. Resolve as needed accepting yours.
  7. Submit to A when ready

Another approach is to create a separate branch where you do your work and then integ to A or B as needed.

The general idea is that Perforce works in terms of submitted or shelved changelists. The idea of integrating an non-committed changelist seems to go against Perforce's natural grain which makes these workarounds cumbersome.

like image 44
Jeff Moser Avatar answered Oct 20 '22 11:10

Jeff Moser