Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 2513:f22e3e8fd457
import: added tests, fixed bugs found by tests and asak.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Tue, 27 Jun 2006 09:30:50 -0700 |
parents | cbff06469488 |
children | a6700c222314 |
line wrap: on
line diff
--- a/mercurial/commands.py Tue Jun 27 10:49:46 2006 -0400 +++ b/mercurial/commands.py Tue Jun 27 09:30:50 2006 -0700 @@ -1787,10 +1787,16 @@ diffs_seen += 1 hgpatch = False fp = cStringIO.StringIO() + if message: + fp.write(message) + fp.write('\n') for line in payload[:m.start(0)].splitlines(): if line.startswith('# HG changeset patch'): ui.debug(_('patch generated by hg export\n')) hgpatch = True + # drop earlier commit message content + fp.seek(0) + fp.truncate() elif hgpatch: if line.startswith('# User '): user = line[7:] @@ -1800,8 +1806,7 @@ if not line.startswith('# '): fp.write(line) fp.write('\n') - hgpatch = False - message = fp.getvalue() or message + message = fp.getvalue() if tmpfp: tmpfp.write(payload) if not payload.endswith('\n'):