Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 24644:51930a7180bd
graft: record intermediate grafts in extras
Previously the extra field for a graft only contained the original commit hash.
This made it impossible to use graft to copy a commit more than once, because
the extras fields did not change after the second graft.
The fix is to add an extra.intermediate-source field that records the immediate
predecessor to graft. This changes hashes for commits that have been grafted
twice, which is why the test was affected.
author | Durham Goode <durham@fb.com> |
---|---|
date | Sun, 05 Apr 2015 12:12:02 -0700 |
parents | 944749de6f3a |
children | bf13b44bbb0a |
comparison
equal
deleted
inserted
replaced
24643:a8e6897dffbe | 24644:51930a7180bd |
---|---|
3545 ui.status(_('grafting %s\n') % desc) | 3545 ui.status(_('grafting %s\n') % desc) |
3546 if opts.get('dry_run'): | 3546 if opts.get('dry_run'): |
3547 continue | 3547 continue |
3548 | 3548 |
3549 source = ctx.extra().get('source') | 3549 source = ctx.extra().get('source') |
3550 if not source: | 3550 extra = {} |
3551 source = ctx.hex() | 3551 if source: |
3552 extra = {'source': source} | 3552 extra['source'] = source |
3553 extra['intermediate-source'] = ctx.hex() | |
3554 else: | |
3555 extra['source'] = ctx.hex() | |
3553 user = ctx.user() | 3556 user = ctx.user() |
3554 if opts.get('user'): | 3557 if opts.get('user'): |
3555 user = opts['user'] | 3558 user = opts['user'] |
3556 date = ctx.date() | 3559 date = ctx.date() |
3557 if opts.get('date'): | 3560 if opts.get('date'): |