cmdserver: recreate mq object on runcommand in case queue path was changed
repo.mq needs to be recreated after queue path change. Since there is little
benefit to keep invalidated mq object, it always delete repo.mq.
--- a/hgext/mq.py Mon Mar 03 19:41:26 2014 +0900
+++ b/hgext/mq.py Mon Mar 03 19:41:30 2014 +0900
@@ -3272,7 +3272,8 @@
def invalidateall(self):
super(mqrepo, self).invalidateall()
if localrepo.hasunfilteredcache(self, 'mq'):
- self.mq.invalidate()
+ # recreate mq in case queue path was changed
+ delattr(self.unfiltered(), 'mq')
def abortifwdirpatched(self, errmsg, force=False):
if self.mq.applied and self.mq.checkapplied and not force:
--- a/tests/test-commandserver.py Mon Mar 03 19:41:26 2014 +0900
+++ b/tests/test-commandserver.py Mon Mar 03 19:41:30 2014 +0900
@@ -283,6 +283,11 @@
# repo.mq should be invalidated
runcommand(server, ['qapplied'])
+ runcommand(server, ['qpop', '--all'])
+ os.system('hg qqueue --create foo')
+ # repo.mq should be recreated to point to new queue
+ runcommand(server, ['qqueue', '--active'])
+
if __name__ == '__main__':
os.system('hg init')
--- a/tests/test-commandserver.py.out Mon Mar 03 19:41:26 2014 +0900
+++ b/tests/test-commandserver.py.out Mon Mar 03 19:41:30 2014 +0900
@@ -228,3 +228,8 @@
runcommand qapplied
runcommand qapplied
0.diff
+ runcommand qpop --all
+popping 0.diff
+patch queue now empty
+ runcommand qqueue --active
+foo