changeset 43066:db33e4f25729

import: add debug messages when parsing data from patch header
author Denis Laxalde <denis@laxalde.org>
date Sun, 06 Oct 2019 12:59:47 +0200
parents 31c1a5376745
children 0fde7d47ad6f
files mercurial/patch.py tests/test-import.t
diffstat 2 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/patch.py	Sun Oct 06 06:55:49 2019 -0700
+++ b/mercurial/patch.py	Sun Oct 06 12:59:47 2019 +0200
@@ -289,6 +289,7 @@
                             prefix = '# %s ' % header
                             if line.startswith(prefix):
                                 data[key] = line[len(prefix):]
+                                ui.debug('%s: %s\n' % (header, data[key]))
                     else:
                         hgpatchheader = False
                 elif line == '---':
--- a/tests/test-import.t	Sun Oct 06 06:55:49 2019 -0700
+++ b/tests/test-import.t	Sun Oct 06 12:59:47 2019 +0200
@@ -34,8 +34,25 @@
   new changesets 80971e65b431
   updating to branch default
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  $ HGEDITOR=cat hg --cwd b import ../exported-tip.patch
+  $ HGEDITOR=cat hg --cwd b import --debug ../exported-tip.patch
   applying ../exported-tip.patch
+  Subject: 
+  
+  Content-Type: text/plain
+  found patch at byte 202
+  patch generated by hg export
+  From: someone
+  Date: 1 0
+  Node ID: 1d4bd90af0e43687763d158dfa83ff2a4b6c0c32
+  message:
+  second change
+  patching file a
+  committing files:
+  a
+  committing manifest
+  committing changelog
+  created 1d4bd90af0e4
+  updating the branch cache
 
 message and committer and date should be same