D10050: test-copies: filter out the linkrev part of `debugindex`

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Mon Feb 22 14:35:12 UTC 2021


marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It is not really useful for the tests and is a large source of churn when adding
  more revisions to the tests.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10050

AFFECTED FILES
  tests/test-copies-chain-merge.t

CHANGE DETAILS

diff --git a/tests/test-copies-chain-merge.t b/tests/test-copies-chain-merge.t
--- a/tests/test-copies-chain-merge.t
+++ b/tests/test-copies-chain-merge.t
@@ -14,6 +14,19 @@
 
 use git diff to see rename
 
+  $ cat << EOF >> ./no-linkrev
+  > #!$PYTHON
+  > # filter out linkrev part of the debugindex command
+  > import sys
+  > for line in sys.stdin:
+  >     if " linkrev " in line:
+  >         print(line.rstrip())
+  >     else:
+  >         l = "%s       *%s" % (line[:6], line[14:].rstrip())
+  >         print(l)
+  > EOF
+  $ chmod +x no-linkrev
+
   $ cat << EOF >> $HGRCPATH
   > [diff]
   > git=yes
@@ -372,12 +385,12 @@
   created new head
   $ hg mv --force i d
   $ hg commit -m "f-2: rename i -> d"
-  $ hg debugindex d
+  $ hg debugindex d | ../no-linkrev
      rev linkrev nodeid       p1           p2
-       0       2 319179230cc8 000000000000 000000000000 (no-changeset !)
-       0       2 56647659eff0 000000000000 000000000000 (changeset !)
-       1       8 b004912a8510 000000000000 000000000000
-       2      22 6cbc9c2b7b39 000000000000 000000000000 (no-changeset !)
+       0       * 319179230cc8 000000000000 000000000000 (no-changeset !)
+       0       * 56647659eff0 000000000000 000000000000 (changeset !)
+       1       * b004912a8510 000000000000 000000000000
+       2       * 6cbc9c2b7b39 000000000000 000000000000 (no-changeset !)
   $ hg up 'desc("b-1")'
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
@@ -1543,13 +1556,13 @@
   $ hg manifest --debug --rev 'desc("b-1")' | grep '644   d'
   319179230cc87769ab3a861ebffe7a534ebb3d85 644   d (no-changeset !)
   56647659eff080e06e45c18ea9e848836dadea71 644   d (changeset !)
-  $ hg debugindex d | head -n 4
+  $ hg debugindex d | head -n 4 | ../no-linkrev
      rev linkrev nodeid       p1           p2
-       0       2 319179230cc8 000000000000 000000000000 (no-changeset !)
-       0       2 56647659eff0 000000000000 000000000000 (changeset !)
-       1       8 b004912a8510 000000000000 000000000000
-       2      22 6cbc9c2b7b39 000000000000 000000000000 (no-changeset !)
-       2      25 b894de5c94aa 56647659eff0 000000000000 (changeset !)
+       0       * 319179230cc8 000000000000 000000000000 (no-changeset !)
+       0       * 56647659eff0 000000000000 000000000000 (changeset !)
+       1       * b004912a8510 000000000000 000000000000
+       2       * 6cbc9c2b7b39 000000000000 000000000000 (no-changeset !)
+       2       * b894de5c94aa 56647659eff0 000000000000 (changeset !)
 
 Log output should not include a merge commit as it did not happen
 
@@ -1610,11 +1623,11 @@
   cedeacc5bf5d9b9be4d7f8394d33a5349bb29c6e 644   f
   $ hg manifest --debug --rev 'desc("e-2")' | grep '644   f'
   08d1ff5926fbd0285cdeb044cbe8ab651687e86a 644   f
-  $ hg debugindex f
+  $ hg debugindex f | ../no-linkrev
      rev linkrev nodeid       p1           p2
-       0       4 cedeacc5bf5d 000000000000 000000000000
-       1      10 08d1ff5926fb 000000000000 000000000000
-       2      19 ffb76cd76542 cedeacc5bf5d 08d1ff5926fb
+       0       * cedeacc5bf5d 000000000000 000000000000
+       1       * 08d1ff5926fb 000000000000 000000000000
+       2       * ffb76cd76542 cedeacc5bf5d 08d1ff5926fb
 #else
   $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644   f'
   56647659eff080e06e45c18ea9e848836dadea71 644   f
@@ -1624,9 +1637,9 @@
   56647659eff080e06e45c18ea9e848836dadea71 644   f
   $ hg manifest --debug --rev 'desc("e-2")' | grep '644   f'
   56647659eff080e06e45c18ea9e848836dadea71 644   f
-  $ hg debugindex f
+  $ hg debugindex f | ../no-linkrev
      rev linkrev nodeid       p1           p2
-       0       4 56647659eff0 000000000000 000000000000
+       0       * 56647659eff0 000000000000 000000000000
 #endif
 
 # Here the filelog based implementation is not looking at the rename



To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list