how to *really* revert?

Matt Mackall mpm at selenic.com
Tue Aug 9 12:31:25 CDT 2005


On Tue, Aug 09, 2005 at 10:16:13AM -0400, Sean Dague wrote:
> I want to sync a tree completely with upstream to resync some changes.  I'm
> confused as to how I do this without just a new clone (which takes 30
> minutes).
> 
> dargo:~/xen-unstable.hg> hg pull
> pulling from http://xenbits.xensource.com/xen-unstable.hg
> searching for changes
> no changes found
> dargo:~/xen-unstable.hg> hg diff
> dargo:~/xen-unstable.hg> hg update
> aborting: outstanding uncommitted merges

You want hg update -C:

$ hg help update
hg update [-m] [-C] [REV]

 -m --merge
   allow merging of conflicts
 -C --clean
   overwrite locally modified files

> dargo:~/xen-unstable.hg> hg revert

Revert doesn't do what you want at all.

> dargo:~/xen-unstable.hg> hg update
> aborting: outstanding uncommitted merges
> 
> If I do an hg commit, there are in fact 4 files that it wants to commit. 
> Why aren't they showing up in hg diff or why isn't hg revert getting rid of
> those?

hg revert reverts to the state of the primary parent. But your working
dir still has two parents. The files reported by commit and status are
the files that are different between those parents.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial mailing list