Patchwork [3,of,6,RFC] phases: allow specifying new commit phase as newcommit with no dash

login
register
mail settings
Submitter Augie Fackler
Date Aug. 2, 2013, 2:15 p.m.
Message ID <b4f222eb288785c43e3d.1375452902@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/1984/
State Deferred
Headers show

Comments

Augie Fackler - Aug. 2, 2013, 2:15 p.m.
# HG changeset patch
# User Augie Fackler <durin42@gmail.com>
# Date 1374709288 14400
#      Wed Jul 24 19:41:28 2013 -0400
# Node ID b4f222eb288785c43e3dbd10b7a115b105ad0b79
# Parent  be6b7556262b8ac6c9f8f7231677f2b9a1f7fcf1
phases: allow specifying new commit phase as newcommit with no dash

Patch

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -281,13 +281,13 @@ 
         if repo.ui.configbool('mq', 'secret', False):
             phase = phases.secret
     if phase is not None:
-        backup = repo.ui.backupconfig('phases', 'new-commit')
+        backup = repo.ui.backupconfig('phases', 'newcommit')
     # Marking the repository as committing an mq patch can be used
     # to optimize operations like branchtags().
     repo._committingpatch = True
     try:
         if phase is not None:
-            repo.ui.setconfig('phases', 'new-commit', phase)
+            repo.ui.setconfig('phases', 'newcommit', phase)
         return repo.commit(*args, **kwargs)
     finally:
         repo._committingpatch = False
@@ -897,7 +897,8 @@ 
         if qfinished and repo.ui.configbool('mq', 'secret', False):
             # only use this logic when the secret option is added
             oldqbase = repo[qfinished[0]]
-            tphase = repo.ui.config('phases', 'new-commit', phases.draft)
+            tphase = repo.ui.config('phases', ['newcommit', 'new-commit'],
+                                    phases.draft)
             if oldqbase.phase() > tphase and oldqbase.p1().phase() <= tphase:
                 phases.advanceboundary(repo, tphase, qfinished)
 
diff --git a/mercurial/phases.py b/mercurial/phases.py
--- a/mercurial/phases.py
+++ b/mercurial/phases.py
@@ -393,7 +393,7 @@ 
     Handle all possible values for the phases.new-commit options.
 
     """
-    v = ui.config('phases', 'new-commit', draft)
+    v = ui.config('phases', ['newcommit', 'new-commit'], draft)
     try:
         return phasenames.index(v)
     except ValueError: