changeset 15934:9d4b5c3cb853

qimport: back out 2eec74d7ce95 This patch presumed mq csets must always be secret, which isn't yet established.
author Matt Mackall <mpm@selenic.com>
date Thu, 19 Jan 2012 11:35:06 -0600
parents b8696a6676be
children 6c97eb445341
files hgext/mq.py tests/test-mq-qimport.t
diffstat 2 files changed, 8 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Thu Jan 19 16:09:43 2012 +0100
+++ b/hgext/mq.py	Thu Jan 19 11:35:06 2012 -0600
@@ -1814,9 +1814,6 @@
 
                 self.added.append(patchname)
                 patchname = None
-            if rev:
-                # if we added anything with rev, we must move the secret root
-                phases.retractboundary(repo, phases.secret, [n])
             self.parseseries()
             self.applieddirty = True
             self.seriesdirty = True
@@ -1991,21 +1988,16 @@
 
     Returns 0 if import succeeded.
     """
-    lock = repo.lock() # cause this may move phase
+    q = repo.mq
     try:
-        q = repo.mq
-        try:
-            q.qimport(repo, filename, patchname=opts.get('name'),
-                  existing=opts.get('existing'), force=opts.get('force'),
-                  rev=opts.get('rev'), git=opts.get('git'))
-        finally:
-            q.savedirty()
-
-
-        if opts.get('push') and not opts.get('rev'):
-            return q.push(repo, None)
+        q.qimport(repo, filename, patchname=opts.get('name'),
+              existing=opts.get('existing'), force=opts.get('force'),
+              rev=opts.get('rev'), git=opts.get('git'))
     finally:
-        lock.release()
+        q.savedirty()
+
+    if opts.get('push') and not opts.get('rev'):
+        return q.push(repo, None)
     return 0
 
 def qinit(ui, repo, create):
--- a/tests/test-mq-qimport.t	Thu Jan 19 16:09:43 2012 +0100
+++ b/tests/test-mq-qimport.t	Thu Jan 19 11:35:06 2012 -0600
@@ -165,8 +165,6 @@
   patch b.diff finalized without changeset message
   patch another.diff finalized without changeset message
   $ hg qimport -rtip -P
-  $ hg phase -r qbase
-  2: secret
   $ hg qpop -a
   popping 2.diff
   patch queue now empty