What to do befor "hg update"

Peter Hosey boredzo at gmail.com
Thu Jul 9 08:16:42 CDT 2009


On Jul 08, 2009, at 10:39:57, Roland Schmitz wrote:
> For every command which is (possible) changing my working copy, my  
> lokal repo or a remote repo there's a "dry run command", expect for  
> update, why?

No, you have that wrong. For every command that changes a repository's  
history*—i.e., push, pull, and unbundle—there's another command or  
a -n option that performs a dry run. None of these commands  
necessarily changes a working copy; indeed, push doesn't at all, and  
pull and unbundle require the -u option to do that.

Update does not change any repository's history. Moreover, it's a  
reversible operation; you can always update to a different revision.  
As such, there's normally no need to preview it.

If you ever do want to preview what update will do, diff -r.:tip won't  
quite do the job. It shows you the difference between former and  
future parent revisions, but does not attempt to dry-run the merge  
into your working copy. As such, if you have outstanding changes (the  
only case for a dry-run update I can think of), there's no way to know  
in advance what Mercurial will do with them.

*The only exception is import, and I presume that's because you can  
just read the file in your editor.




More information about the Mercurial mailing list