Mercurial > evolve
comparison hgext/evolve.py @ 1510:b86eea66ed02
evolve: be more complete about copying extra from old revisions
For 'hg evolve' we want to copy all extra-level metadata except for
branch. This keeps the experimental topics extension from getting
obliterated by evolve runs.
Many hashes in tests changed due to some extra data coming along for
the ride in various places, but no functionality that was tested. It's
plausible that this copies too much metadata - maybe we should be
dropping rebase_src or convert_revision as well. Right now no tools do
that, so I'm biasing towards preserving everything except branch when
copying metadata for now.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Tue, 29 Sep 2015 15:40:28 -0400 |
parents | 405be3783fbc |
children | c40108ae8fb0 |
comparison
equal
deleted
inserted
replaced
1509:405be3783fbc | 1510:b86eea66ed02 |
---|---|
855 if not message: | 855 if not message: |
856 message = old.description() | 856 message = old.description() |
857 | 857 |
858 user = commitopts.get('user') or old.user() | 858 user = commitopts.get('user') or old.user() |
859 date = commitopts.get('date') or None # old.date() | 859 date = commitopts.get('date') or None # old.date() |
860 extra = dict(commitopts.get('extra', {})) | 860 extra = dict(commitopts.get('extra', old.extra())) |
861 extra['branch'] = head.branch() | 861 extra['branch'] = head.branch() |
862 | 862 |
863 new = context.memctx(repo, | 863 new = context.memctx(repo, |
864 parents=newbases, | 864 parents=newbases, |
865 text=message, | 865 text=message, |
941 if r[-1]: #some conflict | 941 if r[-1]: #some conflict |
942 raise util.Abort( | 942 raise util.Abort( |
943 'unresolved merge conflicts (see hg help resolve)') | 943 'unresolved merge conflicts (see hg help resolve)') |
944 if commitmsg is None: | 944 if commitmsg is None: |
945 commitmsg = orig.description() | 945 commitmsg = orig.description() |
946 extra = {'rebase_source': orig.hex()} | 946 extra = dict(orig.extra()) |
947 if 'branch' in extra: | |
948 del extra['branch'] | |
949 extra['rebase_source'] = orig.hex() | |
947 | 950 |
948 backup = repo.ui.backupconfig('phases', 'new-commit') | 951 backup = repo.ui.backupconfig('phases', 'new-commit') |
949 try: | 952 try: |
950 targetphase = max(orig.phase(), phases.draft) | 953 targetphase = max(orig.phase(), phases.draft) |
951 repo.ui.setconfig('phases', 'new-commit', targetphase, 'rebase') | 954 repo.ui.setconfig('phases', 'new-commit', targetphase, 'rebase') |