update -C within branch (was: mercurial/crew-stable@3978: 9 outgoing changesets)

Brendan Cully brendan at kublai.com
Sun Mar 11 16:24:03 CDT 2007


On Sunday, 11 March 2007 at 18:25, Thomas Arendsen Hein wrote:
> * Mercurial Commits <hg at intevation.org> [20070311 13:02]:
> > http://hg.intevation.org/mercurial/crew-stable/rev/fc12ac3755d5
> > changeset:   3978:fc12ac3755d5
> > tag:         tip
> > user:        Brendan Cully <brendan at kublai.com>
> > date:        Sat Mar 10 17:36:29 2007 -0800
> > summary:     Test update to branch tip
> > 
> > http://hg.intevation.org/mercurial/crew-stable/rev/a2335e832e16
> > changeset:   3977:a2335e832e16
> > user:        Brendan Cully <brendan at kublai.com>
> > date:        Sat Mar 10 17:36:27 2007 -0800
> > summary:     Make update with no node jump to the tip of the current branch
> 
> I really like this, but I was a little bit surprised when 'hg co -C'
> didn't switch me to the repo's real tip so I had to use 'hg co -C tip'.
> 
> Usually 'hg co -C' is used to force an update to a different head.
> As branches can have more than head, too, this feature is required,
> and therefore the behavious shouldn't be changed now, but maybe this
> should be mentioned in the help text in a sensible way.

Like so?

By the way, there's an open bug about the fact that you cannot change
heads without clobbering any working directory changes. Is there any
reason not to allow update with an explicit revision to succeed? If
there is, perhaps we should at least have a -f flag to allow this.

I'd also like hg branch to require -f if it would shadow an existing
branch.
-------------- next part --------------
# HG changeset patch
# User Brendan Cully <brendan at kublai.com>
# Date 1173648069 25200
# Node ID e90b4d06aa9d4ab6b2852e86cbaeacb65002c643
# Parent  b5d1eaade333af8e0ba773bd66c04dba5d6016f6
Clarify update help text for update without an explicit revision

diff -r b5d1eaade333 -r e90b4d06aa9d mercurial/commands.py
--- a/mercurial/commands.py	Sat Mar 10 23:21:33 2007 -0300
+++ b/mercurial/commands.py	Sun Mar 11 14:21:09 2007 -0700
@@ -2500,7 +2500,8 @@ def update(ui, repo, node=None, clean=Fa
 def update(ui, repo, node=None, clean=False, date=None):
     """update working directory
 
-    Update the working directory to the specified revision.
+    Update the working directory to the specified revision, or the
+    tip of the current branch if none is specified.
 
     If there are no outstanding changes in the working directory and
     there is a linear relationship between the current version and the


More information about the Mercurial-devel mailing list