[PATCH 1 of 2] import: add debug messages when parsing data from patch header

Denis Laxalde denis at laxalde.org
Sun Oct 6 11:14:22 UTC 2019


# HG changeset patch
# User Denis Laxalde <denis at laxalde.org>
# Date 1570359587 -7200
#      Sun Oct 06 12:59:47 2019 +0200
# Node ID d0e3c6accb3c176527c8b85e739cf1d30343d96d
# Parent  e370f9e4bfad03977309feb121906d6768907701
import: add debug messages when parsing data from patch header

diff --git a/mercurial/patch.py b/mercurial/patch.py
index ae602a6..53cb8a3 100644
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -289,6 +289,7 @@ def _extract(ui, fileobj, tmpname, tmpfp
                             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 == '---':
diff --git a/tests/test-import.t b/tests/test-import.t
index 510a11d..e5c2c35 100644
--- a/tests/test-import.t
+++ b/tests/test-import.t
@@ -34,8 +34,25 @@ commit message and '--edit' is not speci
   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
 


More information about the Mercurial-devel mailing list