[PATCH] speed up bail_if_changed a tiny bit

Christian Ebert blacktrash at gmx.net
Thu Jul 19 05:56:40 CDT 2007


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1184842538 -7200
# Node ID a8d574c457f291fb86686c4a98b1c144427a4993
# Parent  382520bacc17886e0e2fe7fb798a0a5218cf9db1
speed up bail_if_changed a tiny bit

diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -431,8 +431,7 @@ def runcommand(ui, options, cmd, cmdfunc
         return checkargs()
 
 def bail_if_changed(repo):
-    modified, added, removed, deleted = repo.status()[:4]
-    if modified or added or removed or deleted:
+    if repo.status()[:4] != ([], [], [], []):
         raise util.Abort(_("outstanding uncommitted changes"))
 
 def logmessage(opts):


More information about the Mercurial-devel mailing list