Default to "." instead of "tip", r=edmorley
authorSteve Fink <sfink@mozilla.com>
Thu, 31 Oct 2013 14:43:29 -0700
changeset 128 08ee4ab3ee1a
parent 127 0bda039dd274
child 129 f4fff0196015
push id59
push usersfink@mozilla.com
push date2013-10-31 21:43 +0000
reviewersedmorley
Default to "." instead of "tip", r=edmorley
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -29,18 +29,19 @@ and add:
 You can then use it like so:
 hg bzexport [-e] [REV] [BUG|--new]
 
 Where REV is any local revision, and BUG is a bug number on
 bugzilla.mozilla.org or the option '--new' to create a new bug. The extension
 is tuned to work best with MQ changesets (it can only currently work with
 applied patches).
 
-If no revision is specified, it will default to 'tip'. If no bug is specified,
-the changeset commit message will be scanned for a bug number to use.
+If no revision is specified, it will default to '.' (the revision your checkout
+is based on). If no bug is specified, the changeset commit message will be
+scanned for a bug number to use.
 
 This extension also adds a 'newbug' command for creating a new bug without
 attaching anything to it.
 
 """
 from mercurial.i18n import _
 from mercurial import cmdutil, util, patch
 from hgext import mq
@@ -431,25 +432,25 @@ def infer_arguments(ui, repo, args, opts
         # fail later.
     elif len(args) > 2:
         raise util.Abort(_("Too many arguments!"))
     else:
         # Just right.
         rev, bug = args
 
     if rev is None:
-        # Default to 'tip'
-        rev = 'tip'
+        # Default to '.'
+        rev = '.'
 
-    if repo[rev] == repo["tip"]:
+    if repo[rev] == repo["."]:
         m, a, r, d = repo.status()[:4]
         if (m or a or r or d):
             raise util.Abort(_("Local changes found; refresh first!"))
 
-    if rev in ["tip", "qtip", "default"]:
+    if rev in [".", "tip", "qtip", "default"]:
         # Look for a nicer name in the MQ.
         if hasattr(repo, 'mq') and repo.mq.applied:
             rev = repo.mq.applied[-1].name
 
     # Check for bug number in the patch filename
     if bug is None:
         m = re.match(r'bug[_\-]?(\d+)', rev)
         if m: