##// END OF EJS Templates
mq: autodetect an existing git patch during qrefresh (issue 491)
Bryan O'Sullivan -
r4930:fc502517 default
parent child Browse files
Show More
@@ -909,7 +909,16 b' class queue:'
909 patchparent = self.qparents(repo, top)
909 patchparent = self.qparents(repo, top)
910 message, comments, user, date, patchfound = self.readheaders(patchfn)
910 message, comments, user, date, patchfound = self.readheaders(patchfn)
911
911
912 patchf = self.opener(patchfn, "w")
912 patchf = self.opener(patchfn, 'r+')
913
914 # if the patch was a git patch, refresh it as a git patch
915 for line in patchf:
916 if line.startswith('diff --git'):
917 self.diffopts().git = True
918 break
919 patchf.seek(0)
920 patchf.truncate()
921
913 msg = opts.get('msg', '').rstrip()
922 msg = opts.get('msg', '').rstrip()
914 if msg:
923 if msg:
915 if comments:
924 if comments:
@@ -319,6 +319,8 b" hg log -vC --template '{rev} {file_copie"
319 hg qrefresh --git
319 hg qrefresh --git
320 cat .hg/patches/bar
320 cat .hg/patches/bar
321 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
321 hg log -vC --template '{rev} {file_copies%filecopy}\n' -r .
322 hg qrefresh
323 grep 'diff --git' .hg/patches/bar
322
324
323 echo
325 echo
324 hg up -C 1
326 hg up -C 1
@@ -325,6 +325,8 b' diff --git a/foo b/baz'
325 rename from foo
325 rename from foo
326 rename to baz
326 rename to baz
327 2 baz (foo)
327 2 baz (foo)
328 diff --git a/bar b/bar
329 diff --git a/foo b/baz
328
330
329 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
331 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
330 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
332 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
General Comments 0
You need to be logged in to leave comments. Login now