equal
deleted
inserted
replaced
1212 pattern = getstring(args[0], |
1212 pattern = getstring(args[0], |
1213 # i18n: "tag" is a keyword |
1213 # i18n: "tag" is a keyword |
1214 _('the argument to tag must be a string')) |
1214 _('the argument to tag must be a string')) |
1215 kind, pattern, matcher = _stringmatcher(pattern) |
1215 kind, pattern, matcher = _stringmatcher(pattern) |
1216 if kind == 'literal': |
1216 if kind == 'literal': |
1217 if not repo.tags().get(pattern, None): |
1217 # avoid resolving all tags |
|
1218 tn = repo._tagscache.tags.get(pattern, None) |
|
1219 if tn is None: |
1218 raise util.Abort(_("tag '%s' does not exist") % pattern) |
1220 raise util.Abort(_("tag '%s' does not exist") % pattern) |
1219 s = set([cl.rev(n) for t, n in repo.tagslist() if t == pattern]) |
1221 s = set([repo[tn].rev()]) |
1220 else: |
1222 else: |
1221 s = set([cl.rev(n) for t, n in repo.tagslist() if matcher(t)]) |
1223 s = set([cl.rev(n) for t, n in repo.tagslist() if matcher(t)]) |
1222 if not s: |
1224 if not s: |
1223 raise util.Abort(_("no tags exist that match '%s'") % pattern) |
1225 raise util.Abort(_("no tags exist that match '%s'") % pattern) |
1224 else: |
1226 else: |