diff tests/test-mq-guards.t @ 22453:fd0f0b0d316d stable

mq: report correct numbers for changing "number of guarded, applied patches" Before this patch, "hg qselect" may report incorrect numbers for "number of guarded, applied patches has changed", because it examines "pushable" of patches by the index not in "the series" but in "applied patches", even though "mq.pushable()" expects the former. To report correct numbers for changing "number of guarded, applied patches", this patch uses the name of applied patch to examine pushable-ness of it. This patch also changes the result of existing "hg qselect" tests, because they doesn't change pushable-ness of already applied patches. This patch assumes that "hg qselect" focuses on changing pushable-ness only of already applied patches, because: - the report message uses not "previous" (in the series) but "applied" - the logic to pop patches for --pop/--reapply examines pushable-ness only of already applied ones (in fact, there are some incorrect code paths)
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Fri, 12 Sep 2014 02:29:19 +0900
parents 7731a2281cf0
children ac31d87608d6
line wrap: on
line diff
--- a/tests/test-mq-guards.t
+++ b/tests/test-mq-guards.t
@@ -388,7 +388,6 @@
   3 G d.patch
   $ hg qselect 2
   number of unguarded, unapplied patches has changed from 0 to 1
-  number of guarded, applied patches has changed from 1 to 0
   $ qappunappv
   % hg qapplied
   new.patch
@@ -507,3 +506,31 @@
   0 G new.patch
   1 A c.patch
   2 A d.patch
+
+test that qselect shows "number of guarded, applied patches" correctly
+
+  $ hg qimport -q -e b.patch
+  adding b.patch to series file
+  $ hg qguard -- b.patch -not-b
+  $ hg qpop -a -q
+  patch queue now empty
+  $ hg qunapplied -v
+  0 G new.patch
+  1 U c.patch
+  2 U d.patch
+  3 U b.patch
+  $ hg qselect not-new not-c
+  number of unguarded, unapplied patches has changed from 3 to 2
+  $ hg qpush -q -a
+  patch d.patch is empty
+  now at: b.patch
+
+  $ hg qapplied -v
+  0 G new.patch
+  1 G c.patch
+  2 A d.patch
+  3 A b.patch
+  $ hg qselect --none
+  guards deactivated
+  $ hg qselect not-new not-c not-d
+  number of guarded, applied patches has changed from 0 to 1