Show More
@@ -13,6 +13,7 b' import sys' | |||||
13 | from .i18n import _ |
|
13 | from .i18n import _ | |
14 | from .node import ( |
|
14 | from .node import ( | |
15 | hex, |
|
15 | hex, | |
|
16 | nullid, | |||
16 | nullrev, |
|
17 | nullrev, | |
17 | short, |
|
18 | short, | |
18 | wdirrev, |
|
19 | wdirrev, | |
@@ -7500,8 +7501,11 b' def tag(ui, repo, name1, *names, **opts)' | |||||
7500 | ) |
|
7501 | ) | |
7501 | node = logcmdutil.revsingle(repo, rev_).node() |
|
7502 | node = logcmdutil.revsingle(repo, rev_).node() | |
7502 |
|
7503 | |||
|
7504 | # don't allow tagging the null rev or the working directory | |||
7503 | if node is None: |
|
7505 | if node is None: | |
7504 | raise error.InputError(_(b"cannot tag working directory")) |
|
7506 | raise error.InputError(_(b"cannot tag working directory")) | |
|
7507 | elif not opts.get(b'remove') and node == nullid: | |||
|
7508 | raise error.InputError(_(b"cannot tag null revision")) | |||
7505 |
|
7509 | |||
7506 | if not message: |
|
7510 | if not message: | |
7507 | # we don't translate commit messages |
|
7511 | # we don't translate commit messages | |
@@ -7522,13 +7526,6 b' def tag(ui, repo, name1, *names, **opts)' | |||||
7522 | editform=editform, **pycompat.strkwargs(opts) |
|
7526 | editform=editform, **pycompat.strkwargs(opts) | |
7523 | ) |
|
7527 | ) | |
7524 |
|
7528 | |||
7525 | # don't allow tagging the null rev |
|
|||
7526 | if ( |
|
|||
7527 | not opts.get(b'remove') |
|
|||
7528 | and logcmdutil.revsingle(repo, rev_).rev() == nullrev |
|
|||
7529 | ): |
|
|||
7530 | raise error.InputError(_(b"cannot tag null revision")) |
|
|||
7531 |
|
||||
7532 | tagsmod.tag( |
|
7529 | tagsmod.tag( | |
7533 | repo, |
|
7530 | repo, | |
7534 | names, |
|
7531 | names, |
General Comments 0
You need to be logged in to leave comments.
Login now