diff tests/test-mq-subrepo.t @ 17153:54da604fefee

mq: check subrepo synchronizations against parent of workdir or other appropriate context Before this patch, MQ checks each subrepo synchronizations against the working directory context, so ".hgsubstate" updating is not imported into MQ revision correctly in cases below: - qrefresh when current ".hgsubstate" is already synchronized with each subrepos: you can reproduce this easily by just twice or more qrefresh invocations - qnew just after rollback of commit which updates ".hgsubstate" This patch resolves this by checking subrepo states against: - the parent of "qtop" for qrefresh, or - the parent of working context otherwise
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 27 Jun 2012 22:03:27 +0900
parents f287d4a62031
children b61a62714346
line wrap: on
line diff
--- a/tests/test-mq-subrepo.t	Wed Jun 27 22:03:27 2012 +0900
+++ b/tests/test-mq-subrepo.t	Wed Jun 27 22:03:27 2012 +0900
@@ -441,6 +441,74 @@
   -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
   +88ac1bef5ed43b689d1d200b59886b675dec474b sub
 
+  $ hg qrefresh -u test -d '0 0'
+  $ cat .hgsubstate
+  88ac1bef5ed43b689d1d200b59886b675dec474b sub
+  $ hg diff -c tip
+  diff -r 44f846335325 -r b3e8c5fa3aaa .hgsubstate
+  --- a/.hgsubstate
+  +++ b/.hgsubstate
+  @@ -1,1 +1,1 @@
+  -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
+  +88ac1bef5ed43b689d1d200b59886b675dec474b sub
+  $ cat .hg/patches/import-at-qrefresh
+  # HG changeset patch
+  # Date 0 0
+  # User test
+  # Parent 44f846335325209be6be35dc2c9a4be107278c09
+  
+  diff -r 44f846335325 .hgsubstate
+  --- a/.hgsubstate
+  +++ b/.hgsubstate
+  @@ -1,1 +1,1 @@
+  -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
+  +88ac1bef5ed43b689d1d200b59886b675dec474b sub
+
+  $ hg update -C tip
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg qpop -a
+  popping import-at-qrefresh
+  popping import-at-qnew
+  patch queue now empty
+
+  $ hg -R sub update -C 0
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo 'sub = sub' > .hgsub
+  $ hg commit -Am '#1 in parent'
+  adding .hgsub
+  $ hg -R sub update -C 1
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg commit -Am '#2 in parent (but be rollbacked soon)'
+  $ hg rollback
+  repository tip rolled back to revision 1 (undo commit)
+  working directory now based on revision 1
+  $ hg status
+  M .hgsubstate
+  $ hg qnew -u test -d '0 0' checkstate-at-qnew
+  $ hg -R sub parents --template '{node} sub\n'
+  88ac1bef5ed43b689d1d200b59886b675dec474b sub
+  $ cat .hgsubstate
+  88ac1bef5ed43b689d1d200b59886b675dec474b sub
+  $ hg diff -c tip
+  diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
+  --- a/.hgsubstate
+  +++ b/.hgsubstate
+  @@ -1,1 +1,1 @@
+  -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
+  +88ac1bef5ed43b689d1d200b59886b675dec474b sub
+  $ cat .hg/patches/checkstate-at-qnew
+  # HG changeset patch
+  # Parent 4d91eb2fa1d1b22ec513347b9cd06f6b49d470fa
+  # User test
+  # Date 0 0
+  
+  diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
+  --- a/.hgsubstate
+  +++ b/.hgsubstate
+  @@ -1,1 +1,1 @@
+  -b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
+  +88ac1bef5ed43b689d1d200b59886b675dec474b sub
+
   $ cd ..
 
   $ cd ..