Details
Details
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/debugcommands.py (8 lines) | |||
M | tests/test-obsolete.t (4 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
42b9f3aee1f0 | 48ac3ca500fc | Martin von Zweigbergk | Nov 17 2020, 6:37 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
# We do not use revsingle/revrange functions here to accept | # We do not use revsingle/revrange functions here to accept | ||||
# arbitrary node identifiers, possibly not present in the | # arbitrary node identifiers, possibly not present in the | ||||
# local repository. | # local repository. | ||||
n = bin(s) | n = bin(s) | ||||
if len(n) != len(nullid): | if len(n) != len(nullid): | ||||
raise TypeError() | raise TypeError() | ||||
return n | return n | ||||
except TypeError: | except TypeError: | ||||
raise error.Abort( | raise error.InputError( | ||||
b'changeset references must be full hexadecimal ' | b'changeset references must be full hexadecimal ' | ||||
b'node identifiers' | b'node identifiers' | ||||
) | ) | ||||
if opts.get(b'delete'): | if opts.get(b'delete'): | ||||
indices = [] | indices = [] | ||||
for v in opts.get(b'delete'): | for v in opts.get(b'delete'): | ||||
try: | try: | ||||
indices.append(int(v)) | indices.append(int(v)) | ||||
except ValueError: | except ValueError: | ||||
raise error.Abort( | raise error.InputError( | ||||
_(b'invalid index value: %r') % v, | _(b'invalid index value: %r') % v, | ||||
hint=_(b'use integers for indices'), | hint=_(b'use integers for indices'), | ||||
) | ) | ||||
if repo.currenttransaction(): | if repo.currenttransaction(): | ||||
raise error.Abort( | raise error.Abort( | ||||
_(b'cannot delete obsmarkers in the middle of transaction.') | _(b'cannot delete obsmarkers in the middle of transaction.') | ||||
) | ) | ||||
with repo.lock(): | with repo.lock(): | ||||
n = repair.deleteobsmarkers(repo.obsstore, indices) | n = repair.deleteobsmarkers(repo.obsstore, indices) | ||||
ui.write(_(b'deleted %i obsolescence markers\n') % n) | ui.write(_(b'deleted %i obsolescence markers\n') % n) | ||||
return | return | ||||
if precursor is not None: | if precursor is not None: | ||||
if opts[b'rev']: | if opts[b'rev']: | ||||
raise error.Abort(b'cannot select revision when creating marker') | raise error.InputError( | ||||
b'cannot select revision when creating marker' | |||||
) | |||||
metadata = {} | metadata = {} | ||||
metadata[b'user'] = encoding.fromlocal(opts[b'user'] or ui.username()) | metadata[b'user'] = encoding.fromlocal(opts[b'user'] or ui.username()) | ||||
succs = tuple(parsenodeid(succ) for succ in successors) | succs = tuple(parsenodeid(succ) for succ in successors) | ||||
l = repo.lock() | l = repo.lock() | ||||
try: | try: | ||||
tr = repo.transaction(b'debugobsolete') | tr = repo.transaction(b'debugobsolete') | ||||
try: | try: | ||||
date = opts.get(b'date') | date = opts.get(b'date') |
> evolution=exchange | > evolution=exchange | ||||
> evolution.createmarkers=True | > evolution.createmarkers=True | ||||
> EOF | > EOF | ||||
Killing a single changeset without replacement | Killing a single changeset without replacement | ||||
$ hg debugobsolete 0 | $ hg debugobsolete 0 | ||||
abort: changeset references must be full hexadecimal node identifiers | abort: changeset references must be full hexadecimal node identifiers | ||||
[255] | [10] | ||||
$ hg debugobsolete '00' | $ hg debugobsolete '00' | ||||
abort: changeset references must be full hexadecimal node identifiers | abort: changeset references must be full hexadecimal node identifiers | ||||
[255] | [10] | ||||
$ hg debugobsolete -d '0 0' `getid kill_me` -u babar | $ hg debugobsolete -d '0 0' `getid kill_me` -u babar | ||||
1 new obsolescence markers | 1 new obsolescence markers | ||||
obsoleted 1 changesets | obsoleted 1 changesets | ||||
$ hg debugobsolete | $ hg debugobsolete | ||||
97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'} | 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'} | ||||
(test that mercurial is not confused) | (test that mercurial is not confused) | ||||