Mercurial > hg
comparison hgext/mq.py @ 4890:bbdcacf7cef8
mq: autodetect an existing git patch during qrefresh (issue 491)
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon, 16 Jul 2007 16:50:47 -0700 |
parents | cba10652a901 |
children | 6fd953d5faea 8535c1770dd3 |
comparison
equal
deleted
inserted
replaced
4887:2f09df302f30 | 4890:bbdcacf7cef8 |
---|---|
907 top = revlog.bin(top) | 907 top = revlog.bin(top) |
908 cparents = repo.changelog.parents(top) | 908 cparents = repo.changelog.parents(top) |
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: |
916 # Remove existing message. | 925 # Remove existing message. |
917 ci = 0 | 926 ci = 0 |