tests/test-narrow-merge.t
author Raphaël Gomès <rgomes@octobus.net>
Mon, 18 Jul 2022 17:25:49 +0200
changeset 49482 5fbdd88824dc
parent 48716 f1eb77dceb36
child 50725 7e5be4a7cda7
permissions -rw-r--r--
rust-filepatterns: allow overriding default syntax This will be used when parsing pattern files other than .hgignore like the sparse spec.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36084
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
     1
#testcases flat tree
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
     2
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
     3
  $ . "$TESTDIR/narrow-library.sh"
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
     4
36084
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
     5
#if tree
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
     6
  $ cat << EOF >> $HGRCPATH
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
     7
  > [experimental]
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
     8
  > treemanifest = 1
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
     9
  > EOF
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
    10
#endif
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
    11
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    12
create full repo
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    13
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    14
  $ hg init master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    15
  $ cd master
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    16
  $ cat >> .hg/hgrc <<EOF
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    17
  > [narrow]
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    18
  > serveellipses=True
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    19
  > EOF
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    20
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    21
  $ mkdir inside
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    22
  $ echo inside1 > inside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    23
  $ echo inside2 > inside/f2
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    24
  $ mkdir outside
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    25
  $ echo outside1 > outside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    26
  $ echo outside2 > outside/f2
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    27
  $ hg ci -Aqm 'initial'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    28
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    29
  $ echo modified > inside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    30
  $ hg ci -qm 'modify inside/f1'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    31
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    32
  $ hg update -q 0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    33
  $ echo modified > inside/f2
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    34
  $ hg ci -qm 'modify inside/f2'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    35
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    36
  $ hg update -q 0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    37
  $ echo modified2 > inside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    38
  $ hg ci -qm 'conflicting inside/f1'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    39
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    40
  $ hg update -q 0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    41
  $ echo modified > outside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    42
  $ hg ci -qm 'modify outside/f1'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    43
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    44
  $ hg update -q 0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    45
  $ echo modified2 > outside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    46
  $ hg ci -qm 'conflicting outside/f1'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    47
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    48
  $ cd ..
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    49
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    50
  $ hg clone --narrow ssh://user@dummy/master narrow --include inside
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    51
  requesting all changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    52
  adding changesets
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    53
  adding manifests
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    54
  adding file changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    55
  added 6 changesets with 5 changes to 2 files (+4 heads)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    56
  new changesets *:* (glob)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    57
  updating to branch default
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    58
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    59
  $ cd narrow
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    60
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    61
  $ hg update -q 0
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    62
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    63
Can merge in when no files outside narrow spec are involved
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    64
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    65
  $ hg update -q 'desc("modify inside/f1")'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    66
  $ hg merge 'desc("modify inside/f2")'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    67
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    68
  (branch merge, don't forget to commit)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    69
  $ hg commit -m 'merge inside changes'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    70
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    71
Can merge conflicting changes inside narrow spec
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    72
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    73
  $ hg update -q 'desc("modify inside/f1")'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    74
  $ hg merge 'desc("conflicting inside/f1")' 2>&1 | egrep -v '(warning:|incomplete!)'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    75
  merging inside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    76
  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    77
  use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    78
  $ echo modified3 > inside/f1
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    79
  $ hg resolve -m
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    80
  (no more unresolved files)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    81
  $ hg commit -m 'merge inside/f1'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    82
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    83
TODO: Can merge non-conflicting changes outside narrow spec
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    84
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    85
  $ hg update -q 'desc("modify inside/f1")'
48716
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    86
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    87
#if flat
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    88
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
    89
  $ hg merge 'desc("modify outside/f1")'
48716
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    90
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    91
  (branch merge, don't forget to commit)
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    92
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    93
status should be clean
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    94
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    95
  $ hg status
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    96
  ? inside/f1.orig
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    97
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    98
file out of the spec should still not be in the dirstate at all
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
    99
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   100
  $ hg debugdirstate | grep outside/f1
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   101
  [1]
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   102
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   103
Commit that merge
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   104
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   105
  $ hg ci -m 'merge from outside to inside'
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   106
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   107
status should be clean
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   108
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   109
  $ hg status
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   110
  ? inside/f1.orig
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   111
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   112
file out of the spec should not be in the mergestate anymore
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   113
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   114
  $ hg debugmergestate | grep outside/f1
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   115
  [1]
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   116
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   117
file out of the spec should still not be in the dirstate at all
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   118
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   119
  $ hg debugdirstate | grep outside/f1
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   120
  [1]
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   121
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   122
The filenode used should come from p2
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   123
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   124
  $ hg manifest --debug --rev . | grep outside/f1
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   125
  83cd11431a3b2aff8a3995e5f27bcf33cdb5be98 644   outside/f1
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   126
  $ hg manifest --debug --rev 'p1(.)' | grep outside/f1
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   127
  c6b956c48be2cd4fa94be16002aba311143806fa 644   outside/f1
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   128
  $ hg manifest --debug --rev 'p2(.)' | grep outside/f1
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   129
  83cd11431a3b2aff8a3995e5f27bcf33cdb5be98 644   outside/f1
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   130
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   131
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   132
remove the commit to get in the previous situation again
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   133
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   134
  $ hg debugstrip -r .
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   135
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   136
  saved backup bundle to $TESTTMP/narrow/.hg/strip-backup/48eb25338b19-a1bb8350-backup.hg
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   137
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   138
#else
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   139
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   140
  $ hg merge 'desc("modify outside/f1")'
36084
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
   141
  abort: merge affects file 'outside/' outside narrow, which is not yet supported (tree !)
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   142
  (merging in the other direction may work)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   143
  [255]
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   144
48716
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   145
#endif
f1eb77dceb36 narrow: allow merging non-conflicting change outside of the narrow spec
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 48366
diff changeset
   146
36079
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   147
  $ hg update -q 'desc("modify outside/f1")'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   148
  $ hg merge 'desc("modify inside/f1")'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   149
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   150
  (branch merge, don't forget to commit)
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   151
  $ hg ci -m 'merge from inside to outside'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   152
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   153
Refuses merge of conflicting outside changes
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   154
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   155
  $ hg update -q 'desc("modify outside/f1")'
a2a6e724d61a narrow: import experimental extension from narrowhg revision cb51d673e9c5
Augie Fackler <augie@google.com>
parents:
diff changeset
   156
  $ hg merge 'desc("conflicting outside/f1")'
36084
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
   157
  abort: conflict in file 'outside/f1' is outside narrow clone (flat !)
dc01484606da tests: fold narrow treemanifest tests into main test file using testcases
Augie Fackler <augie@google.com>
parents: 36079
diff changeset
   158
  abort: conflict in file 'outside/' is outside narrow clone (tree !)
48366
8e855e9984a6 errors: use detailed exit code when trying to merge file outside narrowspec
Martin von Zweigbergk <martinvonz@google.com>
parents: 36084
diff changeset
   159
  [20]