tests/test-narrow-merge-outside.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Fri, 27 Sep 2024 15:05:26 +0200
changeset 51973 bb281ecf4036
parent 48746 18e69f224e4b
permissions -rw-r--r--
rev-branch-cache: fix message about overwritten data If there is data at the end we ignore, we should not count them as overwritten. This reveal that we something don't overwrite anything, this will be taken car of in the next changeset.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48746
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     1
===================================================================
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     2
Test merge behavior with narrow for item outside of the narrow spec
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     3
===================================================================
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     4
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     5
This test currently check for  simple "outside of narrow" merge case. I suspect
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     6
there might be more corner case that need testing, so extending this tests, or
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     7
replacing it by a more "generative" version, comparing behavior with and without narow.
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     8
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     9
This the feature is currently working with flat manifest only. This is the only
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    10
case tested. Consider using test-case if tree start supporting this case of
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    11
merge.
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    12
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    13
Create some initial setup
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    14
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    15
  $ . "$TESTDIR/narrow-library.sh"
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    16
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    17
  $ hg init server
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    18
  $ echo root > server/root
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    19
  $ mkdir server/inside
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    20
  $ mkdir server/outside
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    21
  $ echo babar > server/inside/inside-change
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    22
  $ echo pom > server/outside/outside-changing
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    23
  $ echo arthur > server/outside/outside-removed
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    24
  $ hg -R server add server/
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    25
  adding server/inside/inside-change
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    26
  adding server/outside/outside-changing
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    27
  adding server/outside/outside-removed
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    28
  adding server/root
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    29
  $ hg -R server commit -m root
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    30
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    31
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    32
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    33
  $ hg clone ssh://user@dummy/server client --narrow --include inside
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    34
  requesting all changes
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    35
  adding changesets
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    36
  adding manifests
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    37
  adding file changes
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    38
  added 1 changesets with 1 changes to 1 files
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    39
  new changesets a0c415d360e5
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    40
  updating to branch default
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    41
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    42
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    43
"trivial" change outside of narrow spec on the server
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    44
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    45
  $ echo zephir > server/outside/outside-added
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    46
  $ hg -R server add server/outside/outside-added
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    47
  $ echo flore > server/outside/outside-changing
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    48
  $ hg -R server remove server/outside/outside-removed
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    49
  $ hg -R server commit -m "outside change"
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    50
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    51
Merge them with some unrelated local change
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    52
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    53
  $ echo celeste > client/inside/inside-change
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    54
  $ hg -R client commit -m "inside change"
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    55
  $ hg -R client pull
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    56
  pulling from ssh://user@dummy/server
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    57
  searching for changes
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    58
  adding changesets
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    59
  adding manifests
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    60
  adding file changes
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    61
  added 1 changesets with 0 changes to 0 files (+1 heads)
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    62
  new changesets f9ec5453023e
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    63
  (run 'hg heads' to see heads, 'hg merge' to merge)
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    64
  $ hg -R client merge
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    65
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    66
  (branch merge, don't forget to commit)
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    67
  $ hg -R client ci -m 'merge changes'
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    68
  $ hg -R client push -r .
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    69
  pushing to ssh://user@dummy/server
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    70
  searching for changes
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    71
  remote: adding changesets
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    72
  remote: adding manifests
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    73
  remote: adding file changes
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    74
  remote: added 2 changesets with 1 changes to 1 files
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    75
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    76
Checking result
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    77
---------------
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    78
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    79
general sentry of all output
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    80
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    81
  $ hg --repository server manifest --debug --rev 0
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    82
  360afd990eeff79e4a7f9f3ded5ecd7bc2fd3b59 644   inside/inside-change
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    83
  7db95ce5cd8e734ad12e3f5f37779a08070a1399 644   outside/outside-changing
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    84
  1591f6db41a30b68bd94ddccf4a4ce4f4fbe2a44 644   outside/outside-removed
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    85
  50ecbc31c0e82dd60c2747c434d1f11b85c0e178 644   root
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    86
  $ hg --repository server manifest --debug --rev 1
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    87
  360afd990eeff79e4a7f9f3ded5ecd7bc2fd3b59 644   inside/inside-change
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    88
  486c008d6dddcaeb5e5f99556a121800cdcfb149 644   outside/outside-added
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    89
  153d7af5e4f53f44475bc0ff2b806c86f019eda4 644   outside/outside-changing
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    90
  50ecbc31c0e82dd60c2747c434d1f11b85c0e178 644   root
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    91
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    92
  $ hg --repository server manifest --debug --rev 2
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    93
  1b3ab69c6c847abc8fd25537241fedcd4d188668 644   inside/inside-change
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    94
  7db95ce5cd8e734ad12e3f5f37779a08070a1399 644   outside/outside-changing
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    95
  1591f6db41a30b68bd94ddccf4a4ce4f4fbe2a44 644   outside/outside-removed
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    96
  50ecbc31c0e82dd60c2747c434d1f11b85c0e178 644   root
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    97
  $ hg --repository server manifest --debug --rev 3
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    98
  1b3ab69c6c847abc8fd25537241fedcd4d188668 644   inside/inside-change
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    99
  486c008d6dddcaeb5e5f99556a121800cdcfb149 644   outside/outside-added
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   100
  153d7af5e4f53f44475bc0ff2b806c86f019eda4 644   outside/outside-changing
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   101
  50ecbc31c0e82dd60c2747c434d1f11b85c0e178 644   root
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   102
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   103
The file changed outside should be changed by the merge
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   104
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   105
  $ hg --repository server manifest --debug --rev 'desc("inside change")' | grep outside-changing
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   106
  7db95ce5cd8e734ad12e3f5f37779a08070a1399 644   outside/outside-changing
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   107
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   108
  $ hg --repository server manifest --debug --rev 'desc("outside change")' | grep outside-changing
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   109
  153d7af5e4f53f44475bc0ff2b806c86f019eda4 644   outside/outside-changing
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   110
  $ hg --repository server manifest --debug --rev 'desc("merge")' | grep outside-changing
18e69f224e4b narrow: add support for merging add and remove outside of the tracked set
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   111
  153d7af5e4f53f44475bc0ff2b806c86f019eda4 644   outside/outside-changing