[issue1192] pull -u should update even if there's nothing to pull

Jason Orendorff mercurial-bugs at selenic.com
Fri Jun 20 15:04:05 CDT 2008

New submission from Jason Orendorff <jorendorff at mozilla.com>:

Currently pull -u doesn't update if there's nothing to pull.

In my experience almost everyone who uses pull -u expects the result
on success to be "my tree is up to date".  This is especially true of
people coming from CVS or svn and looking for the hg equivalent of
"cvs update".  I tripped over this myself when learning Mercurial.
Another Mozilla developer randomly hit it today, and it took him and
another developer 5 minutes to figure out what had happened.  The IRC
transcript is below.  (The line "this has got to be an hg bug" makes
me sad.  Here's a very smart person having a bad experience with hg
because he didn't recognize the state changes resulting from the
commands he's been using.)

I think "hg pull -u" should behave like "hg pull && hg update"; that
is, it should always update, unless the pull fails.  Here's the patch,
per Dirkjan:

Is there a rationale for the current behavior?  It seems quite strange
for those two things (whether any changesets were pulled, and whether
to update) to be connected like that.


gavin: I'm seeing some very strange behavior from hg
gavin: http://pastebin.mozilla.org/464199
gavin: hg diff and hg outgoing show no local changes, but my working
copy of a file doesn't match the repository copy
gavin: this has got to be an hg bug
gavin: the last two changesets touched that line in the file, I wonder
if that's relevant
Mossop: What does |hg parent| say?
gavin: oh...
gavin: it gives an old revision
gavin: wtf?
Mossop: Seems likely your working copy is just an an old changeset,
need to update it
gavin: I've run hg pull -u multiple times
gavin: does that not -u if there's nothing to pull?
Mossop: I've heard that before
gavin: bah
gavin: that's stupid
Mossop: No argument here
gavin: I don't know how I managed to pull without updating at some point

messages: 6373
nosy: djc, jorendorff
priority: bug
status: unread
title: pull -u should update even if there's nothing to pull

Mercurial issue tracker <mercurial-bugs at selenic.com>

More information about the Mercurial-devel mailing list