tests/test-merge-types.t
author Matt Harbison <matt_harbison@yahoo.com>
Sat, 20 Oct 2012 21:43:46 -0400
branchstable
changeset 17847 1e4eb1faba6e
parent 17110 722fd97f6645
child 18334 44bda93df90e
permissions -rw-r--r--
largefiles: use 'default' instead of 'default-push' when pulling (issue3584) This only applies to downloading largefiles, and only when no source for the pull is explicitly provided. The repository itself was properly being pulled via 'default' previously. Using --all-largefiles is not necessary on a bare pull to test this (this existing test is merely a convenience), but it is required to test pulling on the rebase path. Note that the errors generated in the --rebase case are because the repo specified doesn't have the largefiles in its cache (though they are in the user cache), so the errors are misleading. Specifying --all-largefiles when cloning to 'b' fixes this, but instead of errors, it reports caching only 5 largefiles instead of the 9 that come up missing. Likely this is because the largefile download procedure tries to download missing files for each rev, and some of the files have standins in more than one rev that gets pulled.

  $ "$TESTDIR/hghave" symlink execbit || exit 80

  $ 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: False, 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: False, 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)

Update to link without local change should get us a symlink (issue3316):

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

Update to link with local change should cause a merge prompt (issue3200):

  $ hg up -C 0
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ echo data > a
  $ HGMERGE= hg up -y --debug
    searching for copies back to rev 2
  resolving manifests
   overwrite: False, partial: False
   ancestor: c334dc3be0da, local: c334dc3be0da+, remote: 521a1e40188f
   a: versions differ -> m
  preserving a for resolve of a
  updating: a 1/1 files (100.00%)
  (couldn't find merge tool hgmerge|tool hgmerge can't handle symlinks) (re)
  picked tool 'internal:prompt' for a (binary False symlink True)
   no tool found to merge a
  keep (l)ocal or take (o)ther? l
  0 files updated, 1 files merged, 0 files removed, 0 files unresolved
  $ hg diff --git
  diff --git a/a b/a
  old mode 120000
  new mode 100644
  --- a/a
  +++ b/a
  @@ -1,1 +1,1 @@
  -symlink
  \ No newline at end of file
  +data