How to revert open files in workspace WITHOUT removing them from their changelist in perforce?

StackOverflow https://stackoverflow.com/questions/13067709

Frage

Is it possible in perforce (server version 2010.1/265509 (2010/09/23), so I don't have newer "git like" server functionality) to revert all the open files in a client without the files being removed from the changelist they belong to?

By default if I have a file open and in a changelist (non-default), and I want to do a quick "context switch" away from my current working state, look at something else, then return to my prior working state, I do this:

  • Create a new changelist
  • Add files to the new changelist C
  • Shelve files in the changelist C
  • Revert all open files
  • Do stuff
  • revert all open files
  • unshelve changelist C -c C

At the in-between stage during "do stuff", p4 describe C shows no files in the changelist. This is disturbing and annoying and makes keeping track of what's in C harder than it should be.

Is there some way to "revert all open files" so that "p4 describe C" keeps all the files in changelist C?

War es hilfreich?

Lösung

There's no direct way to do what you're specifically asking for (although if you really wanted to, you could write a script to revert the files in a specified changeset and then to immediately reopen them).

However, if your intent is just to list the files in a shelved changeset C, instead of using p4 describe C, you can use p4 files @=C.

Andere Tipps

You can have more than one workspace. I often have dozens of workspaces.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top