mq: add qimported patches if patch dir is a repo
authorVadim Gelfer <vadim.gelfer@gmail.com>
Fri, 23 Jun 2006 12:52:42 -0700
changeset 2488 2785aeb51be4
parent 2487 041363739ca8
child 2489 568e58eed096
mq: add qimported patches if patch dir is a repo
hgext/mq.py
--- a/hgext/mq.py	Fri Jun 23 08:10:06 2006 +0200
+++ b/hgext/mq.py	Fri Jun 23 12:52:42 2006 -0700
@@ -1000,6 +1000,7 @@
             self.ui.warn("-n option not valid when importing multiple files\n")
             sys.exit(1)
         i = 0
+        added = []
         for filename in files:
             if existing:
                 if not patch:
@@ -1028,8 +1029,12 @@
             self.read_series(self.full_series)
             self.ui.warn("adding %s to series file\n" % patch)
             i += 1
+            added.append(patch)
             patch = None
         self.series_dirty = 1
+        qrepo = self.qrepo()
+        if qrepo:
+            qrepo.add(added)
 
 def delete(ui, repo, patch, **opts):
     """remove a patch from the series file"""