Mercurial > hg > mercurial-crew-with-dirclash
comparison hgext/mq.py @ 5175:f8aa16533ddf
Merge with crew-stable
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Wed, 15 Aug 2007 16:22:12 -0700 |
parents | f6c520fd70cf 5bbbd1f1d586 |
children | 90d9ec0dc69d |
comparison
equal
deleted
inserted
replaced
5173:7e05bdeee7de | 5175:f8aa16533ddf |
---|---|
922 # if the patch was a git patch, refresh it as a git patch | 922 # if the patch was a git patch, refresh it as a git patch |
923 for line in patchf: | 923 for line in patchf: |
924 if line.startswith('diff --git'): | 924 if line.startswith('diff --git'): |
925 self.diffopts().git = True | 925 self.diffopts().git = True |
926 break | 926 break |
927 patchf.seek(0) | |
928 patchf.truncate() | |
929 | 927 |
930 msg = opts.get('msg', '').rstrip() | 928 msg = opts.get('msg', '').rstrip() |
931 if msg: | 929 if msg: |
932 if comments: | 930 if comments: |
933 # Remove existing message. | 931 # Remove existing message. |
938 subj = comments[ci][9:] | 936 subj = comments[ci][9:] |
939 while message[mi] != comments[ci] and message[mi] != subj: | 937 while message[mi] != comments[ci] and message[mi] != subj: |
940 ci += 1 | 938 ci += 1 |
941 del comments[ci] | 939 del comments[ci] |
942 comments.append(msg) | 940 comments.append(msg) |
941 | |
942 patchf.seek(0) | |
943 patchf.truncate() | |
944 | |
943 if comments: | 945 if comments: |
944 comments = "\n".join(comments) + '\n\n' | 946 comments = "\n".join(comments) + '\n\n' |
945 patchf.write(comments) | 947 patchf.write(comments) |
946 | 948 |
947 if opts.get('git'): | 949 if opts.get('git'): |