view tests/test-diff-copy-depth.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 bca69641de61
children
line wrap: on
line source

  $ for i in aaa zzz; do
  >     hg init t
  >     cd t
  > 
  >     echo
  >     echo "-- With $i"
  > 
  >     touch file
  >     hg add file
  >     hg ci -m "Add"
  > 
  >     hg cp file $i
  >     hg ci -m "a -> $i"
  > 
  >     hg cp $i other-file
  >     echo "different" >> $i
  >     hg ci -m "$i -> other-file"
  > 
  >     hg cp other-file somename
  > 
  >     echo "Status":
  >     hg st -C
  >     echo
  >     echo "Diff:"
  >     hg diff -g
  > 
  >     cd ..
  >     rm -rf t
  > done
  
  -- With aaa
  Status:
  A somename
    other-file
  
  Diff:
  diff --git a/other-file b/somename
  copy from other-file
  copy to somename
  
  -- With zzz
  Status:
  A somename
    other-file
  
  Diff:
  diff --git a/other-file b/somename
  copy from other-file
  copy to somename