Note: this question is related to, but not a duplicate of How do you clear the default changelist without altering your worktree in Perforce
. My argument is that, while similar, this question is specifically with regards to the P4V client.
Overview
Suppose I'm using perforce to track a file. The current state of the file (file1
) is identical on the server Depot
, and the local Filesystem
For illustration purposes, I will also show the current 'state' of the default Changelist:
| Depot | Filesystem | Changelist |
|-------+------------+----------------|
| file1 | file1 | <empty> |
If I make a change offline (file1
is now file2
), perforce won't know about it yet (I am aware that ideally this shouldn't happen and that all changes should always be tracked, and that the file should have been write protected, but it can if perforce isn't running, the moon is in the wrong quarter, etc. so for the sake of argument, suppose that this did in fact occur):
| Depot | Filesystem | Changelist |
|-------+------------+----------------|
| file1 | file2 | <empty> |
If I Reconcile Offline Work...
or have the file get added manually to the changelist, the changelist now is aware of this change:
| Depot | Filesystem | Changelist |
|-------+------------+----------------|
| file1 | file2 | file1 -> file2 |
If I then submit the changelist, the change it currently has tracked is applied on the server, and the changelist is once again empty:
| Depot | Filesystem | Changelist |
|-------+------------+----------------|
| file2 | file2 | <empty> |
Question
Suppose I've made a change and tracked it. The local filesystem is changed (file2
is now file3
), and the changelist reflects that:
| Depot | Filesystem | Changelist |
|-------+------------+----------------|
| file2 | file3 | file2 -> file3 |
Suppose then that I now want to move back to the state where the workspace/changelist is unaware of file2
having been changed to be file3
, but without actually modifying the file on disk:
| Depot | Filesystem | Changelist |
|-------+------------+----------------|
| file2 | file3 | <empty> |
note how filesystem still is in state file3
, not file2
What would it take to do that? Is there a way to perform this action without backing up the change out of the workspace and reverting completely or running 'clean' and then re-applying the change offline?
I know I don't want to just 'revert' the change, because that reverts not just the state of the changelist but also of the file locally:
| Depot | Filesystem | Changelist |
|-------+------------+----------------|
| file2 | file2 | <empty> |
note how filesystem has lost state file3
and was also reverted to file2
TL;DR:
How can I 'revert' my changelist/workspace to no longer track a change without the file in my local filesystem being reverted, or modified in any way?
I'm using the P4V v2015.2