changeset 42427:027f1567f97f

copies: separate added/removed files by newline instead of null This makes it more consistent with how we encode copies (newline-separated lists of null-separated pairs). This perhaps makes {extras} a little less readable (?) despite avoiding the escaping. I don't know how I feel about this patch. I'm okay with it being queued or dropped. Differential Revision: https://phab.mercurial-scm.org/D6486
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 06 Jun 2019 10:07:14 -0700
parents a1f87294471f
children ae3f862cbb3d
files mercurial/changelog.py tests/test-copies-in-changeset.t tests/test-copies.t
diffstat 3 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changelog.py	Wed May 22 09:54:00 2019 -0700
+++ b/mercurial/changelog.py	Thu Jun 06 10:07:14 2019 -0700
@@ -109,12 +109,12 @@
     for i, f in enumerate(files):
         if f in subset:
             indices.append('%d' % i)
-    return '\0'.join(indices)
+    return '\n'.join(indices)
 
 def decodefileindices(files, data):
     try:
         subset = []
-        for strindex in data.split('\0'):
+        for strindex in data.split('\n'):
             i = int(strindex)
             if i < 0 or i >= len(files):
                 return None
--- a/tests/test-copies-in-changeset.t	Wed May 22 09:54:00 2019 -0700
+++ b/tests/test-copies-in-changeset.t	Thu Jun 06 10:07:14 2019 -0700
@@ -25,7 +25,9 @@
   $ hg ci -m 'copy a to b, c, and d'
   $ hg changesetcopies
   files: b c d
-  filesadded: 0\x001\x002 (esc)
+  filesadded: 0
+  1
+  2
   
   p1copies: 0\x00a (esc)
   1\x00a (esc)
@@ -95,7 +97,9 @@
   $ hg ci -m 'merge'
   $ hg changesetcopies
   files: g h i
-  filesadded: 0\x001\x002 (esc)
+  filesadded: 0
+  1
+  2
   
   p1copies: 0\x00a (esc)
   2\x00f (esc)
--- a/tests/test-copies.t	Wed May 22 09:54:00 2019 -0700
+++ b/tests/test-copies.t	Thu Jun 06 10:07:14 2019 -0700
@@ -620,7 +620,7 @@
 
   $ hg rebase -r . -d 2 -t :other
   rebasing 5:5018b1509e94 "added willconflict and d" (tip) (no-changeset !)
-  rebasing 5:619047c26bf8 "added willconflict and d" (tip) (changeset !)
+  rebasing 5:af8d273bf580 "added willconflict and d" (tip) (changeset !)
 
   $ hg up 3 -q
   $ hg l --hidden
@@ -644,4 +644,4 @@
 
   $ hg graft -r 6 --base 4 --hidden -t :other
   grafting 6:99802e4f1e46 "added willconflict and d" (tip) (no-changeset !)
-  grafting 6:9ddc6fb3b691 "added willconflict and d" (tip) (changeset !)
+  grafting 6:b19f0df72728 "added willconflict and d" (tip) (changeset !)