Mark
Mark

Reputation: 2227

THG strip does not keep changes in the working directory

I committed a changeset which is now in the "draft" Phase. It is the latest (local) revision. I want to remove that changeset and move all the changes back to the working directory. That means I want the opposite of committing it (which is working directory -> revision).

I tried the strip command with both keep and without. In both cases my changeset is removed but the changes are gone and the working directory is still empty. Then I need to unbundle the backup and pull it, at which point I'm exactly where I started with the local changeset in the history.

How do I move the changes from the committed changeset to the working directory? Maybe backout?

I'm using TortoiseHg but can also use the console there.

Upvotes: 1

Views: 246

Answers (2)

StayOnTarget
StayOnTarget

Reputation: 13037

This doesn't directly answer the issue about the behavior of strip, but another way to do this in THG would be:

  1. Shelve anything of value in your working folder

  2. Update to the last-desired revision (the one before the revision you mean to undo)

  3. Select the revision you want to undo and click "Revert All Files..."

  4. Let it revert. The working folder will now match the revision you want to undo.

  5. Strip (without "keep") the unwanted revision. Or even just leave it there and ignore it.

Upvotes: 1

Mark
Mark

Reputation: 2227

Looks like I managed to solve it, though I don't really understand how it works.

Following this answer I updated to my revision, switch to Ammend which showed the patch changes in the working directory as well as the revision, then strip with keep removed the revision, only the working directory now contains the files because of Ammend.

Upvotes: 0

Related Questions