tests/test-merge-types.t
author Adrian Buehlmann <adrian@cadifra.com>
Tue, 23 Nov 2010 22:53:47 +0100
branchstable
changeset 13038 670f4e98276d
parent 12279 28e2e3804f2e
child 15441 e0348815e806
permissions -rw-r--r--
checknlink: return False if .hgtmp file preexists (issue2517) If os_link fails on Windows, errno is always errno.EINVAL, so we can't really say if the testlink could not be created because (a) the FS doesn't support hardlinks or (b) there is a leaked .hgtmp file lying around from a previous crashed run. So let's err on the safe side, keep the code simple and assume we can't detect hardlinks in both cases.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     1
  $ hg init
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     2
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     3
  $ echo a > a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     4
  $ hg ci -Amadd
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     5
  adding a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     6
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     7
  $ chmod +x a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
     8
  $ hg ci -mexecutable
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
     9
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    10
  $ hg up 0
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    11
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    12
  $ rm a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    13
  $ ln -s symlink a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    14
  $ hg ci -msymlink
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    15
  created new head
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    16
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    17
  $ hg merge --debug
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    18
    searching for copies back to rev 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    19
  resolving manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    20
   overwrite None partial False
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    21
   ancestor c334dc3be0da local 521a1e40188f+ remote 3574f3e69b1c
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    22
   conflicting flags for a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    23
  (n)one, e(x)ec or sym(l)ink? n
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    24
   a: update permissions -> e
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    25
  updating: a 1/1 files (100.00%)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    26
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    27
  (branch merge, don't forget to commit)
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    28
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    29
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    30
Symlink is local parent, executable is other:
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    31
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    32
  $ if [ -h a ]; then
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    33
  >     echo a is a symlink
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    34
  >     $TESTDIR/readlink.py a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    35
  > elif [ -x a ]; then
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    36
  >     echo a is executable
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    37
  > else
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    38
  >     echo "a has no flags (default for conflicts)"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    39
  > fi
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    40
  a has no flags (default for conflicts)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    41
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    42
  $ hg update -C 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    43
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    44
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    45
  $ hg merge --debug
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    46
    searching for copies back to rev 1
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    47
  resolving manifests
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    48
   overwrite None partial False
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    49
   ancestor c334dc3be0da local 3574f3e69b1c+ remote 521a1e40188f
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    50
   conflicting flags for a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    51
  (n)one, e(x)ec or sym(l)ink? n
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    52
   a: remote is newer -> g
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    53
  updating: a 1/1 files (100.00%)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    54
  getting a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    55
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    56
  (branch merge, don't forget to commit)
5503
6f26c7677463 Test a merge of a symlink against an executable file.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
    57
12279
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    58
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    59
Symlink is other parent, executable is local:
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    60
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    61
  $ if [ -h a ]; then
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    62
  >    echo a is a symlink
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    63
  >    $TESTDIR/readlink.py a
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    64
  > elif [ -x a ]; then
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    65
  >     echo a is executable
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    66
  > else
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    67
  >     echo "a has no flags (default for conflicts)"
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    68
  > fi
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    69
  a has no flags (default for conflicts)
28e2e3804f2e combine tests
Adrian Buehlmann <adrian@cadifra.com>
parents: 5710
diff changeset
    70