# HG changeset patch # User Brendan Cully # Date 1154727363 25200 # Node ID e3564699409cf0925ef8ff40a8f99338eab6034d # Parent 6b27a7125b674f9ce55d2c058b57944c09097195 Add '.' as a shortcut revision name for the working directory parent. diff -r 6b27a7125b67 -r e3564699409c mercurial/commands.py --- a/mercurial/commands.py Sat Aug 05 02:00:09 2006 -0700 +++ b/mercurial/commands.py Fri Aug 04 14:36:03 2006 -0700 @@ -2789,8 +2789,8 @@ necessary. The file '.hg/localtags' is used for local tags (not shared among repositories). """ - if name == "tip": - raise util.Abort(_("the name 'tip' is reserved")) + if name in ['tip', '.']: + raise util.Abort(_("the name '%s' is reserved") % name) if rev_ is not None: ui.warn(_("use of 'hg tag NAME [REV]' is deprecated, " "please use 'hg tag [-r REV] NAME' instead\n")) diff -r 6b27a7125b67 -r e3564699409c mercurial/localrepo.py --- a/mercurial/localrepo.py Sat Aug 05 02:00:09 2006 -0700 +++ b/mercurial/localrepo.py Fri Aug 04 14:36:03 2006 -0700 @@ -292,6 +292,10 @@ try: return self.tags()[key] except KeyError: + if key == '.': + key = self.dirstate.parents()[0] + if key == nullid: + raise repo.RepoError(_("no revision checked out")) try: return self.changelog.lookup(key) except: