Jump to content

"The root item can't be reverted" message blocking all reverts


Eric Carter

Recommended Posts

Hi,

You cannot revert the root item of the workspace to a previous revision.

Quote

I'm trying to revert my repository to revision 4, but every time I select a changest in the history and pick "Revert to revision" I get an error dialog that says "The root item can't be reverted". How do I get my old changes back?

In order to do that, please open the branch explorer (or changesets view) --> right-click the selected changeset --> "Switch workspace to this changeset".

Regards,

Carlos.

Link to comment
Share on other sites

Thanks Carlos,

If you can't revert from the History panel, why does it present you with that option? Is this a bug? It's super confusing. I wasted more than an hour trying to figure it out, and solved it by trashing my repo and starting over from scratch.

After I switch my workspace via the branch explorer, there are no pending changes, nothing to check in. How do I make this code state the new tip of the branch? I am trying to revert all the changes after this one, so this state needs to get back into the repo somehow.

Link to comment
Share on other sites

Let me try to clarify the differences:

- Revert: Your workspace selector is always pointing to a specific changeset. But you can revert a specific file to a previous revisions. After reverting the file to a previous revision, you can cehckin your changes.

- Update/switch: This is the oepration you need to run to point your workspace to a different changeset/branch. This operation is not allowed if you have pending to commit changes (you will need to commit first).

- "Pending changes" view + "Undo" operation: If you have some pending to commit changes in your workspace and you want to undo them. This way, your workspace will be pointing to the same changeset/branch but with no pending to commit changes.

Regards,

Carlos.

Link to comment
Share on other sites

I understand the differences between those 3 actions. But check this out:

I can get the History of my entire depo by selecting View History on the root:
image.png.a2f662d4d6e1c970b3e6873e64c9acf0.png

From here, I can select a diff and choose Revert:

image.png.865b69ea86467c392d6e65c1358389f2.png

Now, this seems to be like a totally reasonable thing to express. I want to revert all files to the state they were in in version 3. The expected outcome of a naive user is unambiguous. In your post above you said that reverting the root node is not possible (presumably because of some technical restriction).

So my first thought is: feature request, either make it so I can revert the root node like any other folder, or improve the flow in a way where you don't offer me this revert option that won't work.

My second thought is: how do I actually do the thing I want? I need the tip of master to be the same as it was in revision 4. Update/Switch doesn't help me, because I'm not trying to get my local copy to revision 4, I'm trying to revert all the changes to all files that happened from revision 5, 6, 7, 8, 9, and 10. I want master to be the same as it was in revision 4. In other source control solutions I simply revert all files to their state in revision 4 and check in. In Plastic, I can't do that because the root node cannot be reverted. I'd have to go through item by item reverting every file individually.

image.png

Link to comment
Share on other sites

Hi,

Quote

Now, this seems to be like a totally reasonable thing to express. I want to revert all files to the state they were in in version 3. The expected outcome of a naive user is unambiguous. In your post above you said that reverting the root node is not possible (presumably because of some technical restriction).

So my first thought is: feature request, either make it so I can revert the root node like any other folder, or improve the flow in a way where you don't offer me this revert option that won't work.

The key thing is what you call revert all files o the state they were in in version 3 is actually switching your workspace to the changeset 3. 

The basic unit in Plastic is the changeset (not the file) so your workspace needs to be pointing always to a specific changeset. You cannot have some files in your workspace pointing to a changeset and some other files pointing to a different changeset (unless you are using a Gluon workspace).

The "revert to this revision" is only applyed for specific files/folders. But note if you revert a file revision to a previous version, the workspace will be still pointing to the same changeset (it cannot be reverted).

I understand it can be confusing (specially if you are comming from a different version control) but the revert workspace operation in Plastic is called "switch workspace/update". 

 

Quote

My second thought is: how do I actually do the thing I want? I need the tip of master to be the same as it was in revision 4. Update/Switch doesn't help me, because I'm not trying to get my local copy to revision 4, I'm trying to revert all the changes to all files that happened from revision 5, 6, 7, 8, 9, and 10. I want master to be the same as it was in revision 4. In other source control solutions I simply revert all files to their state in revision 4 and check in. In Plastic, I can't do that because the root node cannot be reverted. I'd have to go through item by item reverting every file individually

As I commented, in Plastic the basic unit is the changeset, no de the file (the same as git and all the modern SCMs). Every changeset is a snapshot of your project a specific time. 

If you want to switch the workspace to same status it was in changeset 4, you need to use the "Switch workspace to changeset 4". If you switch to changeset 4, your workspace will not include the changes performed on changesets 5,6,7,8,9 and 10.

Regards,

Carlos.

 

Link to comment
Share on other sites

  • 2 weeks later...

No, no, this is not confusing at all. I understand perfectly what you're describing, but you're answering a different question than I'm asking.

You're describing how I can make my local workspace match the state of changeset 4.

What I'm asking is how do I generate an changeset which is the inverse of changes 5 through 9, that when committed, will leave the remote repository's contents bitwise equal to the state it was in in changeset 4. I am attempting to generate changeset 10, a change which removes all the changes in changesets 5 through 9. Whether my local workspace is pointed at changeset 4, 5, 9, or 10 after I am done isn't important.

Link to comment
Share on other sites

Hmmm... that page describes the process for subtractive merging, but doesn't actually say how to do a subtractive merge? I'm also worried that this is getting a lot more complicated than I'd like it to be. In Perforce or Git, I right click a changeset, pick the rollback option, and submit and I'm done. How many subtractive merge operations do I need to do to roll back 4 changesets?

This page says that it's possible to remove changesets:
https://www.plasticscm.com/book/#_delete_empty_branches_only

Removing changesets 5 thru 9 seems simpler, and will leave me with a cleaner history. How do I do that? (Again, the page in the book doesn't explain how to actually do the thing it describes).

Link to comment
Share on other sites

Hi Eric,

You just need to perform a subtractive merge operation for the changeset interval you desire. This is also right-click operation from the branch explorer.

image.png

We don't normally recommend to delete changesets (this way the history will be lost) but it's also doable from the "Advanded" panel. Also, you can only delete a changeset if it's the last of the branch.

Regards,

Carlos.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...