Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/commands.py @ 28794:2637d6ad3e61
commands: disallow 'hg debugobsolete --index --rev <smth>'
A bug in the original --index implementation. The goal of --index is to allow
unique obsmarker identification that would be consistent between invocations
of this command in the unchanged repo. Further goal is to use this index to
delete arbitrary obsmarkers. So calling --index together with --rev would
cause obsmarker indices to be different than just calling --index. This is
not desired and current pattern for getting the index of an interesting
obsmarker is: `$ hg debugobsolete --index | grep <interesting hash>`.
It would clearly be better if we could somehow compute a hash of an obsmarker
and use it to identify the one we want to delete, but it seems a bit too
heavy for our current goals, so we can do this later if we want.
author | Kostia Balytskyi <ikostia@fb.com> |
---|---|
date | Fri, 01 Apr 2016 15:20:31 -0700 |
parents | c4b727795d6a |
children | f456834b2f7e |
comparison
equal
deleted
inserted
replaced
28793:d30fdd6d1bf7 | 28794:2637d6ad3e61 |
---|---|
3093 finally: | 3093 finally: |
3094 tr.release() | 3094 tr.release() |
3095 finally: | 3095 finally: |
3096 l.release() | 3096 l.release() |
3097 else: | 3097 else: |
3098 if opts.get('rev') and opts.get('index'): | |
3099 hint = _("call 'hg debugobsolete --index' without other arguments") | |
3100 raise error.Abort(_("cannot use --index with --rev"), hint=hint) | |
3098 if opts['rev']: | 3101 if opts['rev']: |
3099 revs = scmutil.revrange(repo, opts['rev']) | 3102 revs = scmutil.revrange(repo, opts['rev']) |
3100 nodes = [repo[r].node() for r in revs] | 3103 nodes = [repo[r].node() for r in revs] |
3101 markers = list(obsolete.getmarkers(repo, nodes=nodes)) | 3104 markers = list(obsolete.getmarkers(repo, nodes=nodes)) |
3102 markers.sort(key=lambda x: x._data) | 3105 markers.sort(key=lambda x: x._data) |