diff mercurial/patch.py @ 42861:1fd530b1e1cf

split: handle partial commit of copies when doing split or record When using split or record, using either interface (text or curses), selecting portions of the file to be committed/recorded did not work; the entire file was treated as having been selected. This appears to be because the logic for handling partial application of the patches relies on knowing what files are "new with modifications", and it doesn't treat "copy destination" as "new". Handling renames correctly is more difficult and will be done in a later patch. Differential Revision: https://phab.mercurial-scm.org/D6767
author Kyle Lippincott <spectral@google.com>
date Tue, 27 Aug 2019 11:56:15 -0700
parents f802a75da585
children 3cf091843b4f
line wrap: on
line diff
--- a/mercurial/patch.py	Sun Sep 01 23:43:59 2019 -0700
+++ b/mercurial/patch.py	Tue Aug 27 11:56:15 2019 -0700
@@ -864,7 +864,7 @@
     allhunks_re = re.compile('(?:index|deleted file) ')
     pretty_re = re.compile('(?:new file|deleted file) ')
     special_re = re.compile('(?:index|deleted|copy|rename|new mode) ')
-    newfile_re = re.compile('(?:new file)')
+    newfile_re = re.compile('(?:new file|copy to)')
 
     def __init__(self, header):
         self.header = header