Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Revert --all in TortoiseHg Workbench

Simple question: is there a way to revert --all from TortoiseHg workbench? I see how to revert an individual file. Ideally, I could click on a revision, and from the right mouse menu find a "revert all" item.

I'm using TortoiseHg 2.8 on a Ubuntu box.

EDIT I should have provided more details on my question to provide some context. Let me describe the particular use case:

I want to put my working directory back to the state of a past commit so I can generate output from the executable that I know was "good". Once I've generated that output, I want to go back to the tip and continue my development, keeping this history linear. From the command line, I did "hg revert --all --rev 22", generated the output, then "hg revert --all", which did what I wanted. "hg update" will create a history with a branch (if I'm understanding correctly). FWIW there is an "update" button in TortoiseHg (in the box where the list of files is shown) as well as a right-mouse menu item on a given revision.

like image 216
adt_Jeff Avatar asked Aug 09 '13 20:08

adt_Jeff


1 Answers

To set the working directory to match the state of a given changeset (which could be tip), you can use Update:

  1. Right click on the changeset you want to 'revert' to.
  2. Select "Update"
  3. Check the "Discard local changes" checkbox
  4. Click Update

It would be hg update -r changeset -C in the console.

Now you can create the output from the 'state' of the working directory at that point in history (i.e. from the executable at that changeset). If you don't make any commits here there will be no changeset created and therefore nothing is added to the repo history.

Once you have the output to your satisfaction, you can update again to the tip of development via the same process and continue your work:

  1. Right click on the tip of development.
  2. Select "Update"
  3. Check the "Discard local changes" checkbox
  4. Click update

The benefit of using update over revert is that Tortoise will explicitly display the parent of the working directory as the changeset it history. Under revert it could be very easy to revert the files and lose track of which changeset you had reverted to and which part of history you occupied.

(This is assuming that you want to move to that point in the history. If you need to create a changeset that undoes a prior changeset, look into backout, though I'm not sure if that is available in Tortoise.)


like image 141
Edward Avatar answered Oct 10 '22 09:10

Edward