view tests/test-merge-types.t @ 12681:bc13e17067d9

update: use higher level wording for "crosses branches" error When using "hg update" to update to a revision on another branch, if the user has uncommitted changes in the working directory, hg aborts with the following message: abort: crosses branches (use 'hg merge' to merge or use 'hg update -C' to discard changes) If the user isn't trying to update to tip and they follow the command examples verbatim, they would end up updating to the wrong revision. This patch removes the command examples in favor of just telling the user to either merge or use --clean: abort: crosses branches (merge branches or use --clean to discard changes) hg also aborts if the user tries to use "hg update" to get to tip (without specifying a revision) and tip is on another branch: abort: crosses branches (use 'hg merge' or use 'hg update -c') This message is changed in the same fashion: abort: crosses branches (merge branches or use --check to force update)
author Brodie Rao <brodie@bitheap.org>
date Sat, 09 Oct 2010 17:02:28 -0500
parents 28e2e3804f2e
children e0348815e806
line wrap: on
line source

  $ hg init

  $ echo a > a
  $ hg ci -Amadd
  adding a

  $ chmod +x a
  $ hg ci -mexecutable

  $ hg up 0
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ rm a
  $ ln -s symlink a
  $ hg ci -msymlink
  created new head

  $ hg merge --debug
    searching for copies back to rev 1
  resolving manifests
   overwrite None partial False
   ancestor c334dc3be0da local 521a1e40188f+ remote 3574f3e69b1c
   conflicting flags for a
  (n)one, e(x)ec or sym(l)ink? n
   a: update permissions -> e
  updating: a 1/1 files (100.00%)
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  (branch merge, don't forget to commit)


Symlink is local parent, executable is other:

  $ if [ -h a ]; then
  >     echo a is a symlink
  >     $TESTDIR/readlink.py a
  > elif [ -x a ]; then
  >     echo a is executable
  > else
  >     echo "a has no flags (default for conflicts)"
  > fi
  a has no flags (default for conflicts)

  $ hg update -C 1
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved

  $ hg merge --debug
    searching for copies back to rev 1
  resolving manifests
   overwrite None partial False
   ancestor c334dc3be0da local 3574f3e69b1c+ remote 521a1e40188f
   conflicting flags for a
  (n)one, e(x)ec or sym(l)ink? n
   a: remote is newer -> g
  updating: a 1/1 files (100.00%)
  getting a
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  (branch merge, don't forget to commit)


Symlink is other parent, executable is local:

  $ if [ -h a ]; then
  >    echo a is a symlink
  >    $TESTDIR/readlink.py a
  > elif [ -x a ]; then
  >     echo a is executable
  > else
  >     echo "a has no flags (default for conflicts)"
  > fi
  a has no flags (default for conflicts)