Re: [p4] Best way to revert an opened change without reverting changes in workspace?
Sambwise <[email protected]>
| Newsgroups | gmane.comp.version-control.perforce |
|---|---|
| Message-ID | <[email protected]> |
Posted on behalf of forum user 'Sambwise'. [https://forums.perforce.com/index.php?app=forums&module=forums§ion=findpost&pid=22172] mcru, on 2017/08/07 22:43:14 UTC, said: > What is the best way to revert an opened change without reverting changes in the workspace? > > Example... > > I modify two files, fileA.txt and fileB.txt. I run p4 rec and both files are opened for edit. Now, I decide that I only want to commit changes to fileB.txt, but I don't want to run p4 revert on fileA.txt because I don't want to lose my changes on it. How do I revert fileA.txt to remove it from my list of open files without losing my local changes? > > In this simple example I know you could just p4 submit and pass the file name, or modify the changelist specification, but imagine you had a good number of files opened. How would you do this? > It doesn't sound like you want to revert the change; if you use 'revert -k' the change becomes untracked and it's at risk of being overwritten. Instead I think you want to move it to a new changelist. p4 change p4 reopen -c CHANGE fileB.txt The "p4 reopen" command accepts a wildcard exp ression so if instead of a single file fileB.txt you have a lot of files that all match some pattern (e.g. everything in a particular directory, or with a particular extension) it's still just one command to do this. You can do this as many times as you like with as many different changelists as you like; the whole idea behind being able to create new pending changelists is that you can divide pending work into different atomic units and submit each changelist independently. -- Please click here to see the post in its original format: http://forums.perforce.com/index.php?/topic/5436-best-way-to-revert-an-opened-change-without-reverting-changes-in-workspace _______________________________________________ perforce-user mailing list - [email protected] http://maillist.perforce.com/mailman/listinfo/perforce-user