[issue737] pull -u vs pull; update inconsistency with named branches

Jesse Keating mercurial-bugs at selenic.com
Thu Sep 13 10:29:08 CDT 2007


New submission from Jesse Keating <jkeating at redhat.com>:

So I decided to play with the internal branching stuff again,
specifically with "default" branch in mind.

A little bit of setup.  Create a repo, add some files.  Then clone this
repo somewhere else, three times (three different locations).  In one
of the locations, create a branch and commit some changes to the
branch, push it back to the original repo.  In one of the other two, do
a hg pull, then an hg update.  In the third, do an hg pull -u.  You'll
notice that in the second (pull; update), your working copy is still the
"default"
branch and nothing has changed, although your repodata knows about the
new branch.  In the third (pull -u) your working copy has been switched
to the branch and your content has changed.  This doesn't seem right to
me, inconsistent.  I'd /really/ like the way that pull; update works, I
don't want my working copy suddenly switched to a branch just because
it had the last update done to it.  Here is my test case:



[jkeating at lumos test]$ hg clone head/ head1
4 files updated, 0 files merged, 0 files removed, 0 files unresolved

[jkeating at lumos test]$ hg clone head/ head2
4 files updated, 0 files merged, 0 files removed, 0 files unresolved

[jkeating at lumos test]$ cd head1

[jkeating at lumos head1]$ hg branch
default

[jkeating at lumos head1]$ cd ../head2/

[jkeating at lumos head2]$ hg branch
default

[jkeating at lumos head2]$ cd ../try2/

[jkeating at lumos try2]$ hg branch coolbranch

[jkeating at lumos try2]$ hg branch
coolbranch

[jkeating at lumos try2]$ vim rock.star 

[jkeating at lumos try2]$ hg commit

[jkeating at lumos try2]$ hg push
pushing to /home/jkeating/test/head
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files

[jkeating at lumos try2]$ cd ../

[jkeating at lumos test]$ cd head1/

[jkeating at lumos head1]$ ls
bangle  bar  baz  foo

[jkeating at lumos head1]$ hg pull
pulling from /home/jkeating/test/head
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)

[jkeating at lumos head1]$ hg branch
default

[jkeating at lumos head1]$ hg update
0 files updated, 0 files merged, 0 files removed, 0 files unresolved

[jkeating at lumos head1]$ hg branch
default

[jkeating at lumos head1]$ cd ../head2/

[jkeating at lumos head2]$ hg pull -u
pulling from /home/jkeating/test/head
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
3 files updated, 0 files merged, 0 files removed, 0 files unresolved

[jkeating at lumos head2]$ hg branch
coolbranch

----------
messages: 3992
nosy: jkeating
priority: bug
status: unread
title: pull -u vs pull; update inconsistency with named branches

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue737>
____________________________________________________



More information about the Mercurial-devel mailing list