##// END OF EJS Templates
Add '.' as a shortcut revision name for the working directory parent.
Brendan Cully -
r2789:e3564699 default
parent child Browse files
Show More
@@ -2789,8 +2789,8 def tag(ui, repo, name, rev_=None, **opt
2789 necessary. The file '.hg/localtags' is used for local tags (not
2789 necessary. The file '.hg/localtags' is used for local tags (not
2790 shared among repositories).
2790 shared among repositories).
2791 """
2791 """
2792 if name == "tip":
2792 if name in ['tip', '.']:
2793 raise util.Abort(_("the name 'tip' is reserved"))
2793 raise util.Abort(_("the name '%s' is reserved") % name)
2794 if rev_ is not None:
2794 if rev_ is not None:
2795 ui.warn(_("use of 'hg tag NAME [REV]' is deprecated, "
2795 ui.warn(_("use of 'hg tag NAME [REV]' is deprecated, "
2796 "please use 'hg tag [-r REV] NAME' instead\n"))
2796 "please use 'hg tag [-r REV] NAME' instead\n"))
@@ -292,6 +292,10 class localrepository(repo.repository):
292 try:
292 try:
293 return self.tags()[key]
293 return self.tags()[key]
294 except KeyError:
294 except KeyError:
295 if key == '.':
296 key = self.dirstate.parents()[0]
297 if key == nullid:
298 raise repo.RepoError(_("no revision checked out"))
295 try:
299 try:
296 return self.changelog.lookup(key)
300 return self.changelog.lookup(key)
297 except:
301 except:
General Comments 0
You need to be logged in to leave comments. Login now