Commits

Patrick Mézard  committed c4461ea

patch: fix patched files records in externalpatcher()

  • Participants
  • Parent commits 2fef305

Comments (0)

Files changed (3)

File mercurial/patch.py

         if line.startswith('patching file '):
             pf = util.parse_patch_output(line)
             printed_file = False
-            files.setdefault(pf, (None, None))
+            files.setdefault(pf, None)
         elif line.find('with fuzz') >= 0:
             fuzz = True
             if not printed_file:

File tests/test-import

 hg --cwd b tip | grep someone
 rm -r b
 
+echo % import exported patch with external patcher
+cat > dummypatch.py <<EOF
+print 'patching file a'
+file('a', 'wb').write('line2\n')
+EOF
+chmod +x dummypatch.py
+hg clone -r0 a b
+hg --cwd a export tip > tip.patch
+hg --config ui.patch='python ../dummypatch.py' --cwd b import ../tip.patch
+cat b/a
+rm -r b
+
 echo % import of plain diff should fail without message
 hg clone -r0 a b
 hg --cwd a diff -r0:1 > tip.patch

File tests/test-import.out

 summary:     second change
 % committer should be same
 user:        someone
+% import exported patch with external patcher
+requesting all changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 2 changes to 2 files
+updating working directory
+2 files updated, 0 files merged, 0 files removed, 0 files unresolved
+applying ../tip.patch
+line2
 % import of plain diff should fail without message
 requesting all changes
 adding changesets