changeset 11530:958022f0f1d5 stable

mq: reset self.added after the mq transaction instead of inside qimport It seems wiser to reset mq.added at the end of the mq transaction instead of at the beginning of a qimport call: this way, calling several times qimport() without saving mq state in-between does not overwrite the previous value of mq.added (this happens, for example in rebase, where we import several patches in a batch before calling .save_dirty() )
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Mon, 12 Jul 2010 17:55:23 +0900
parents dec57aa0f8ca
children 59bd20451ab6
files hgext/mq.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Thu Jul 08 15:44:14 2010 +0200
+++ b/hgext/mq.py	Mon Jul 12 17:55:23 2010 +0900
@@ -1623,7 +1623,6 @@
         if (len(files) > 1 or len(rev) > 1) and patchname:
             raise util.Abort(_('option "-n" not valid when importing multiple '
                                'patches'))
-        self.added = []
         if rev:
             # If mq patches are applied, we can only import revisions
             # that form a linear path to qbase.
@@ -1813,6 +1812,7 @@
         qrepo = q.qrepo()
         if qrepo:
             qrepo[None].add(q.added)
+        q.added = []
 
     if opts.get('push') and not opts.get('rev'):
         return q.push(repo, None)