[PATCH 08 of 10] mq: rename secretcommit to newcommit

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Mon Jan 30 10:49:42 CST 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1327878328 -3600
# Branch stable
# Node ID 44bfd92fa0f75504c460ef4c9f9fc28aca147a84
# Parent  3bb3d9aa2b12313264fe346fbb48d40d83e31de7
mq: rename secretcommit to newcommit

This function create secret changeset only when mq.secret is true

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -255,14 +255,15 @@ class patchheader(object):
         for mi in self.message:
             while mi != self.comments[ci]:
                 ci += 1
             del self.comments[ci]
 
-def secretcommit(repo, *args, **kwargs):
-    """helper dedicated to ensure a commit are secret
-
-    It should be used instead of repo.commit inside the mq source
+def newcommit(repo, *args, **kwargs):
+    """helper dedicated to ensure a commit respect mq.secret setting
+
+    It should be used instead of repo.commit inside the mq source for operation
+    creating new changeset.
     """
     if not repo.ui.configbool('mq', 'secret', False):
         return repo.commit(*args, **kwargs)
 
     backup = repo.ui.backupconfig('phases', 'new-commit')
@@ -573,11 +574,11 @@ class queue(object):
 
         ctx = repo[rev]
         ret = hg.merge(repo, rev)
         if ret:
             raise util.Abort(_("update returned %d") % ret)
-        n = secretcommit(repo, ctx.description(), ctx.user(), force=True)
+        n = newcommit(repo, ctx.description(), ctx.user(), force=True)
         if n is None:
             raise util.Abort(_("repo commit failed"))
         try:
             ph = patchheader(mergeq.join(patch), self.plainmode)
         except:
@@ -743,11 +744,11 @@ class queue(object):
                     repo.dirstate.merge(f)
                 p1, p2 = repo.dirstate.parents()
                 repo.dirstate.setparents(p1, merge)
 
             match = scmutil.matchfiles(repo, files or [])
-            n = secretcommit(repo, message, ph.user, ph.date, match=match,
+            n = newcommit(repo, message, ph.user, ph.date, match=match,
                              force=True)
             if n is None:
                 raise util.Abort(_("repository commit failed"))
 
             if update_status:
@@ -982,11 +983,11 @@ class queue(object):
                     if date:
                         p.write("# Date %s %s\n\n" % date)
                 if util.safehasattr(msg, '__call__'):
                     msg = msg()
                 commitmsg = msg and msg or ("[mq]: %s" % patchfn)
-                n = secretcommit(repo, commitmsg, user, date, match=match,
+                n = newcommit(repo, commitmsg, user, date, match=match,
                                  force=True)
                 if n is None:
                     raise util.Abort(_("repo commit failed"))
                 try:
                     self.fullseries[insert:insert] = [patchfn]


More information about the Mercurial-devel mailing list