Mercurial > hg > mercurial-source
diff mercurial/commands.py @ 16668:2a71cc53f244
graft: implement --log (issue3438)
author | Levi Bard <levi@unity3d.com> |
---|---|
date | Fri, 11 May 2012 18:51:35 +0200 |
parents | 58edd786e96f |
children | 525fdb738975 |
line wrap: on
line diff
--- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -2581,6 +2581,7 @@ 'graft', [('c', 'continue', False, _('resume interrupted graft')), ('e', 'edit', False, _('invoke editor on commit messages')), + ('', 'log', None, _('append graft info to log message')), ('D', 'currentdate', False, _('record the current date as commit date')), ('U', 'currentuser', False, @@ -2599,6 +2600,11 @@ Changesets that are ancestors of the current revision, that have already been grafted, or that are merges will be skipped. + If --log is specified, log messages will have a comment appended + of the form:: + + (grafted from CHANGESETHASH) + If a graft merge results in conflicts, the graft process is interrupted so that the current merge can be manually resolved. Once all conflicts are addressed, the graft process can be @@ -2748,7 +2754,10 @@ date = ctx.date() if opts.get('date'): date = opts['date'] - node = repo.commit(text=ctx.description(), user=user, + message = ctx.description() + if opts.get('log'): + message += '\n(grafted from %s)' % ctx.hex() + node = repo.commit(text=message, user=user, date=date, extra=extra, editor=editor) if node is None: ui.status(_('graft for revision %s is empty\n') % ctx.rev())