[Bug 4709] New: `hg pull -B foo --update` do not update to foo

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Wed Jun 3 18:49:16 CDT 2015


http://bz.selenic.com/show_bug.cgi?id=4709

          Priority: normal
            Bug ID: 4709
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: `hg pull -B foo --update` do not update to foo
          Severity: bug
    Classification: Unclassified
                OS: All
          Reporter: pierre-yves.david at ens-lyon.org
          Hardware: All
            Status: UNCONFIRMED
           Version: earlier
         Component: bookmarks
           Product: Mercurial

Running `hg pull --rev foo --update` will get you to 'foo' whatever your
original branch is. However hg pull --bookmark foo --update` will not.

The test below reveal the issue:


  diff --git a/tests/test-pull-update.t b/tests/test-pull-update.t
  --- a/tests/test-pull-update.t
  +++ b/tests/test-pull-update.t
  @@ -59,6 +59,58 @@ Should work:
     adding manifests
     adding file changes
     added 1 changesets with 1 changes to 1 files (-1 heads)
     1 files updated, 0 files merged, 0 files removed, 0 files unresolved

  +Test -u with -r
  +
  +  $ echo 'foo' > ../tt/f1
  +  $ hg -R ../tt/ bookmark foo
  +  $ hg -R ../tt branch 'foo' # to confuse auto update
  +  marked working directory as branch foo
  +  (branches are permanent and global, did you want a bookmark?)
  +  $ hg -R ../tt/ commit -A -m 'f1'
  +  adding f1
  +  $ hg pull --update --rev foo ../tt
  +  pulling from ../tt
  +  searching for changes
  +  adding changesets
  +  adding manifests
  +  adding file changes
  +  added 1 changesets with 1 changes to 1 files
  +  adding remote bookmark foo
  +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  +  $ hg log -r .
  +  changeset:   4:17a0a5b5f8b9
  +  branch:      foo
  +  bookmark:    foo
  +  tag:         tip
  +  user:        test
  +  date:        Thu Jan 01 00:00:00 1970 +0000
  +  summary:     f1
  +  
  +
  +Test -u with -B
  +
  +  $ echo 'foo' > ../tt/f2
  +  $ hg -R ../tt branch 'bar' # to confuse auto update
  +  marked working directory as branch bar
  +  $ hg -R ../tt/ commit -A -m 'f2'
  +  adding f2
  +  $ hg pull --update --bookmark foo ../tt --traceback
  +  pulling from ../tt
  +  searching for changes
  +  adding changesets
  +  adding manifests
  +  adding file changes
  +  added 1 changesets with 1 changes to 1 files
  +  updating bookmark foo
  +  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  +  $ hg log -r .
  +  changeset:   5:ca9048fc8fa8
  +  branch:      bar
  +  bookmark:    foo
  +  tag:         tip
  +  summary:     f2
  +  
  +
     $ cd ..

it fails with:

  --- /home/pyd/src/mercurial-dev/tests/test-pull-update.t
  +++ /home/pyd/src/mercurial-dev/tests/test-pull-update.t.err
  @@ -104,13 +104,13 @@
     adding file changes
     added 1 changesets with 1 changes to 1 files
     updating bookmark foo
  -  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  +  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
     $ hg log -r .
  -  changeset:   5:ca9048fc8fa8
  -  branch:      bar
  -  bookmark:    foo
  -  tag:         tip
  -  summary:     f2
  +  changeset:   4:17a0a5b5f8b9
  +  branch:      foo
  +  user:        test
  +  date:        Thu Jan 01 00:00:00 1970 +0000
  +  summary:     f1


     $ cd ..

ERROR: test-pull-update.t output changed

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list