# HG changeset patch # User Matt Mackall # Date 2014-07-31 21:32:12 # Node ID fd7839d1107dbc5523222fac5d5971da4939cfe7 # Parent ef555e456420d66dad5deea5923ce9e134ccd7b4 qimport: record imported revs incrementally (issue3874) When an import fails, this doesn't lose the state for the earlier revisions. diff --git a/hgext/mq.py b/hgext/mq.py --- a/hgext/mq.py +++ b/hgext/mq.py @@ -1995,12 +1995,12 @@ class queue(object): self.added.append(patchname) imported.append(patchname) patchname = None - if rev and repo.ui.configbool('mq', 'secret', False): - # 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 + if rev and repo.ui.configbool('mq', 'secret', False): + # if we added anything with --rev, move the secret root + phases.retractboundary(repo, phases.secret, [n]) + self.parseseries() + self.applieddirty = True + self.seriesdirty = True for i, filename in enumerate(files): if existing: diff --git a/tests/test-mq-qimport.t b/tests/test-mq-qimport.t --- a/tests/test-mq-qimport.t +++ b/tests/test-mq-qimport.t @@ -196,6 +196,14 @@ try to import --push now at: appendbar.diff $ hg qfin -a patch b.diff finalized without changeset message + $ touch .hg/patches/2.diff + $ hg qimport -r 'p1(.)::' + abort: patch "2.diff" already exists + [255] + $ hg qapplied + 3.diff + $ hg qfin -a + $ rm .hg/patches/2.diff $ hg qimport -r 'p1(.)::' -P $ hg qpop -a popping 3.diff