0

I am using Mercurial ("HG"), I am trying to Clean the repo from uncomm­itted Changes using :

hg update --clean -R rpeo_path

It will Clean The repo and move to tip ( it will change the changeset )

How can i Clean the repo from uncomm­itted changes and stay in the current Changeset ?

Thanks in advance

AhmedMItman
  • 247
  • 1
  • 3
  • 13
  • Possible duplicate of [Mercurial: How do you undo changes?](https://stackoverflow.com/questions/3214035/mercurial-how-do-you-undo-changes) – StayOnTarget Apr 09 '19 at 11:20

2 Answers2

1

The simplest is probably to use hg revert --all.

With no revision specified, revert the specified files or directories to the contents they had in the parent of the working directory. This restores the contents of files to an unmodified state...

The --all option will

revert all changes when no arguments given

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
0

I solved :

current_changeset = hg id -i
hg update --clean -R repo_path -r current_changeset

Please keep me updated if you have another opinion

AhmedMItman
  • 247
  • 1
  • 3
  • 13