sapling/tests/test-mq-subrepo.t

621 lines
15 KiB
Perl
Raw Normal View History

$ cat <<EOF >> $HGRCPATH
> [ui]
> commitsubrepos = Yes
> [extensions]
> mq =
> record =
> [diff]
> nodates = 1
> EOF
$ stdin=`pwd`/stdin.tmp
fn to create new repository w/dirty subrepo, and cd into it
$ mkrepo() {
> hg init $1
> cd $1
> hg qinit
> }
fn to create dirty subrepo
$ mksubrepo() {
> hg init $1
> cd $1
> echo a > a
> hg add
> cd ..
> }
$ testadd() {
> cat - > "$stdin"
> mksubrepo sub
> echo sub = sub >> .hgsub
> hg add .hgsub
> echo % abort when adding .hgsub w/dirty subrepo
> hg status -S
> echo '%' $*
> cat "$stdin" | hg $*
> echo [$?]
> hg -R sub ci -m0sub
> echo % update substate when adding .hgsub w/clean updated subrepo
> hg status -S
> echo '%' $*
> cat "$stdin" | hg $*
> hg debugsub
> }
$ testmod() {
> cat - > "$stdin"
> mksubrepo sub2
> echo sub2 = sub2 >> .hgsub
> echo % abort when modifying .hgsub w/dirty subrepo
> hg status -S
> echo '%' $*
> cat "$stdin" | hg $*
> echo [$?]
> hg -R sub2 ci -m0sub2
> echo % update substate when modifying .hgsub w/clean updated subrepo
> hg status -S
> echo '%' $*
> cat "$stdin" | hg $*
> hg debugsub
> }
$ testrm1() {
> cat - > "$stdin"
> mksubrepo sub3
> echo sub3 = sub3 >> .hgsub
> hg ci -Aqmsub3
> $EXTRA
> echo b >> sub3/a
> hg rm .hgsub
> echo % update substate when removing .hgsub w/dirty subrepo
> hg status -S
> echo '%' $*
> cat "$stdin" | hg $*
> echo % debugsub should be empty
> hg debugsub
> }
$ testrm2() {
> cat - > "$stdin"
> mksubrepo sub4
> echo sub4 = sub4 >> .hgsub
> hg ci -Aqmsub4
> $EXTRA
> hg rm .hgsub
> echo % update substate when removing .hgsub w/clean updated subrepo
> hg status -S
> echo '%' $*
> cat "$stdin" | hg $*
> echo % debugsub should be empty
> hg debugsub
> }
handle subrepos safely on qnew
$ mkrepo repo-2499-qnew
qnew: omit meaningless and harmful putting subrepositories into target list Before this patch, qnew puts updated subrepositories into target list forcibly, if any of -I, -X or patterns are specified. But this is meaningless and harmful, because: - putting subrepositories into target list doesn't affect the result of "localrepository.status()" "dirstate.status()" invoked via "localrepository.status()" always omits subrepositories from the result of it - any -I/-X opts and empty "pats" causes unexpected failure when any -I/-X opts are specified, "inclsubs" are always added to "pats", even if "pats" is empty. but this changes meaning of "pats" from "including all to be included" to "including only listed subrepositories" this may exclude ".hgsub" and cause unexpected exception raising ("can't commit subrepos without .hgsub" ). - qnew at other than repository root (with -I, -X or any patterns) causes unexpected failure "scmutil.match()" treats pattern without syntax type as 'relpath' type (= one rooted at cwd). but qnew puts subrepository paths rooted at the repository root, and it causes unexpected exception raising ("SUBREPO not under root ROOT" in "pathutil.canonpath()"), if "hg qnew" is executed at other than repository root with -I, -X or any patterns. This patch omits meaningless and harmful putting subrepositories into target list. This omitting doesn't miss including updated subrepositories, because subrepositories are specified to "scmutil.matchfiles()" directly, to get "match" object for "localrepository.commit()".
2014-03-19 19:10:45 +04:00
$ testadd qnew -X path:no-effect -m0 0.diff
adding a
% abort when adding .hgsub w/dirty subrepo
A .hgsub
A sub/a
qnew: omit meaningless and harmful putting subrepositories into target list Before this patch, qnew puts updated subrepositories into target list forcibly, if any of -I, -X or patterns are specified. But this is meaningless and harmful, because: - putting subrepositories into target list doesn't affect the result of "localrepository.status()" "dirstate.status()" invoked via "localrepository.status()" always omits subrepositories from the result of it - any -I/-X opts and empty "pats" causes unexpected failure when any -I/-X opts are specified, "inclsubs" are always added to "pats", even if "pats" is empty. but this changes meaning of "pats" from "including all to be included" to "including only listed subrepositories" this may exclude ".hgsub" and cause unexpected exception raising ("can't commit subrepos without .hgsub" ). - qnew at other than repository root (with -I, -X or any patterns) causes unexpected failure "scmutil.match()" treats pattern without syntax type as 'relpath' type (= one rooted at cwd). but qnew puts subrepository paths rooted at the repository root, and it causes unexpected exception raising ("SUBREPO not under root ROOT" in "pathutil.canonpath()"), if "hg qnew" is executed at other than repository root with -I, -X or any patterns. This patch omits meaningless and harmful putting subrepositories into target list. This omitting doesn't miss including updated subrepositories, because subrepositories are specified to "scmutil.matchfiles()" directly, to get "match" object for "localrepository.commit()".
2014-03-19 19:10:45 +04:00
% qnew -X path:no-effect -m0 0.diff
abort: uncommitted changes in subrepository 'sub'
[255]
% update substate when adding .hgsub w/clean updated subrepo
A .hgsub
qnew: omit meaningless and harmful putting subrepositories into target list Before this patch, qnew puts updated subrepositories into target list forcibly, if any of -I, -X or patterns are specified. But this is meaningless and harmful, because: - putting subrepositories into target list doesn't affect the result of "localrepository.status()" "dirstate.status()" invoked via "localrepository.status()" always omits subrepositories from the result of it - any -I/-X opts and empty "pats" causes unexpected failure when any -I/-X opts are specified, "inclsubs" are always added to "pats", even if "pats" is empty. but this changes meaning of "pats" from "including all to be included" to "including only listed subrepositories" this may exclude ".hgsub" and cause unexpected exception raising ("can't commit subrepos without .hgsub" ). - qnew at other than repository root (with -I, -X or any patterns) causes unexpected failure "scmutil.match()" treats pattern without syntax type as 'relpath' type (= one rooted at cwd). but qnew puts subrepository paths rooted at the repository root, and it causes unexpected exception raising ("SUBREPO not under root ROOT" in "pathutil.canonpath()"), if "hg qnew" is executed at other than repository root with -I, -X or any patterns. This patch omits meaningless and harmful putting subrepositories into target list. This omitting doesn't miss including updated subrepositories, because subrepositories are specified to "scmutil.matchfiles()" directly, to get "match" object for "localrepository.commit()".
2014-03-19 19:10:45 +04:00
% qnew -X path:no-effect -m0 0.diff
path sub
source sub
revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
qnew: omit meaningless and harmful putting subrepositories into target list Before this patch, qnew puts updated subrepositories into target list forcibly, if any of -I, -X or patterns are specified. But this is meaningless and harmful, because: - putting subrepositories into target list doesn't affect the result of "localrepository.status()" "dirstate.status()" invoked via "localrepository.status()" always omits subrepositories from the result of it - any -I/-X opts and empty "pats" causes unexpected failure when any -I/-X opts are specified, "inclsubs" are always added to "pats", even if "pats" is empty. but this changes meaning of "pats" from "including all to be included" to "including only listed subrepositories" this may exclude ".hgsub" and cause unexpected exception raising ("can't commit subrepos without .hgsub" ). - qnew at other than repository root (with -I, -X or any patterns) causes unexpected failure "scmutil.match()" treats pattern without syntax type as 'relpath' type (= one rooted at cwd). but qnew puts subrepository paths rooted at the repository root, and it causes unexpected exception raising ("SUBREPO not under root ROOT" in "pathutil.canonpath()"), if "hg qnew" is executed at other than repository root with -I, -X or any patterns. This patch omits meaningless and harmful putting subrepositories into target list. This omitting doesn't miss including updated subrepositories, because subrepositories are specified to "scmutil.matchfiles()" directly, to get "match" object for "localrepository.commit()".
2014-03-19 19:10:45 +04:00
$ testmod qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
adding a
% abort when modifying .hgsub w/dirty subrepo
M .hgsub
A sub2/a
qnew: omit meaningless and harmful putting subrepositories into target list Before this patch, qnew puts updated subrepositories into target list forcibly, if any of -I, -X or patterns are specified. But this is meaningless and harmful, because: - putting subrepositories into target list doesn't affect the result of "localrepository.status()" "dirstate.status()" invoked via "localrepository.status()" always omits subrepositories from the result of it - any -I/-X opts and empty "pats" causes unexpected failure when any -I/-X opts are specified, "inclsubs" are always added to "pats", even if "pats" is empty. but this changes meaning of "pats" from "including all to be included" to "including only listed subrepositories" this may exclude ".hgsub" and cause unexpected exception raising ("can't commit subrepos without .hgsub" ). - qnew at other than repository root (with -I, -X or any patterns) causes unexpected failure "scmutil.match()" treats pattern without syntax type as 'relpath' type (= one rooted at cwd). but qnew puts subrepository paths rooted at the repository root, and it causes unexpected exception raising ("SUBREPO not under root ROOT" in "pathutil.canonpath()"), if "hg qnew" is executed at other than repository root with -I, -X or any patterns. This patch omits meaningless and harmful putting subrepositories into target list. This omitting doesn't miss including updated subrepositories, because subrepositories are specified to "scmutil.matchfiles()" directly, to get "match" object for "localrepository.commit()".
2014-03-19 19:10:45 +04:00
% qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
abort: uncommitted changes in subrepository 'sub2'
[255]
% update substate when modifying .hgsub w/clean updated subrepo
M .hgsub
qnew: omit meaningless and harmful putting subrepositories into target list Before this patch, qnew puts updated subrepositories into target list forcibly, if any of -I, -X or patterns are specified. But this is meaningless and harmful, because: - putting subrepositories into target list doesn't affect the result of "localrepository.status()" "dirstate.status()" invoked via "localrepository.status()" always omits subrepositories from the result of it - any -I/-X opts and empty "pats" causes unexpected failure when any -I/-X opts are specified, "inclsubs" are always added to "pats", even if "pats" is empty. but this changes meaning of "pats" from "including all to be included" to "including only listed subrepositories" this may exclude ".hgsub" and cause unexpected exception raising ("can't commit subrepos without .hgsub" ). - qnew at other than repository root (with -I, -X or any patterns) causes unexpected failure "scmutil.match()" treats pattern without syntax type as 'relpath' type (= one rooted at cwd). but qnew puts subrepository paths rooted at the repository root, and it causes unexpected exception raising ("SUBREPO not under root ROOT" in "pathutil.canonpath()"), if "hg qnew" is executed at other than repository root with -I, -X or any patterns. This patch omits meaningless and harmful putting subrepositories into target list. This omitting doesn't miss including updated subrepositories, because subrepositories are specified to "scmutil.matchfiles()" directly, to get "match" object for "localrepository.commit()".
2014-03-19 19:10:45 +04:00
% qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
path sub
source sub
revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
path sub2
source sub2
revision 1f94c7611cc6b74f5a17b16121a1170d44776845
$ hg qpop -qa
patch queue now empty
$ testrm1 qnew -m2 2.diff
adding a
% update substate when removing .hgsub w/dirty subrepo
M sub3/a
R .hgsub
% qnew -m2 2.diff
% debugsub should be empty
$ hg qpop -qa
patch queue now empty
$ testrm2 qnew -m3 3.diff
adding a
% update substate when removing .hgsub w/clean updated subrepo
R .hgsub
% qnew -m3 3.diff
% debugsub should be empty
$ cd ..
handle subrepos safely on qrefresh
$ mkrepo repo-2499-qrefresh
$ hg qnew -m0 0.diff
$ testadd qrefresh
adding a
% abort when adding .hgsub w/dirty subrepo
A .hgsub
A sub/a
% qrefresh
abort: uncommitted changes in subrepository 'sub'
[255]
% update substate when adding .hgsub w/clean updated subrepo
A .hgsub
% qrefresh
path sub
source sub
revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
$ hg qnew -m1 1.diff
$ testmod qrefresh
adding a
% abort when modifying .hgsub w/dirty subrepo
M .hgsub
A sub2/a
% qrefresh
abort: uncommitted changes in subrepository 'sub2'
[255]
% update substate when modifying .hgsub w/clean updated subrepo
M .hgsub
% qrefresh
path sub
source sub
revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
path sub2
source sub2
revision 1f94c7611cc6b74f5a17b16121a1170d44776845
$ hg qpop -qa
patch queue now empty
$ EXTRA='hg qnew -m2 2.diff'
$ testrm1 qrefresh
adding a
% update substate when removing .hgsub w/dirty subrepo
M sub3/a
R .hgsub
% qrefresh
% debugsub should be empty
$ hg qpop -qa
patch queue now empty
$ EXTRA='hg qnew -m3 3.diff'
$ testrm2 qrefresh
adding a
% update substate when removing .hgsub w/clean updated subrepo
R .hgsub
% qrefresh
% debugsub should be empty
$ EXTRA=
$ cd ..
handle subrepos safely on qpush/qpop
(and we cannot qpop / qpush with a modified subrepo)
$ mkrepo repo-2499-qpush
$ mksubrepo sub
adding a
$ hg -R sub ci -m0sub
$ echo sub = sub > .hgsub
$ hg add .hgsub
$ hg commit -m0
$ hg debugsub
path sub
source sub
revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
$ echo foo > ./sub/a
$ hg -R sub commit -m foo
$ hg commit -m1
$ hg qimport -r "0:tip"
mq: update subrepos when applying / unapplying patches that change .hgsubstate Up until now applying or unapplying a patch that modified .hgsubstate would not work as expected because it would not update the subrepos according to the .hgsubstate change. This made it very easy to lose subrepo changes when using mq. This revision also changes the test-mq-subrepo test so that on the qpop / qpush tests. We no longer use the debugsub command to check the state of the subrepos after the qpop and qpush operations. Instead we directly run the id command on the subrepos that we want to check. The reason is that using the debugsub command is misleading because it does not really check the state of the subrepos on the working directory (it just returns what the change that is specified on a given revision). Because of this the tests did not detect the problem that this revision fixes (i.e. that applying a patch did not update the subrepos to the corresponding revisions). # HG changeset patch # User Angel Ezquerra <angel.ezquerra@gmail.com> # Date 1376350710 -7200 # Tue Aug 13 01:38:30 2013 +0200 # Node ID 60897e264858cdcd46f89e27a702086f08adca02 # Parent 2defb5453f223c3027eb2f7788fbddd52bbb3352 mq: update subrepos when applying / unapplying patches that change .hgsubstate Up until now applying or unapplying a patch that modified .hgsubstate would not work as expected because it would not update the subrepos according to the .hgsubstate change. This made it very easy to lose subrepo changes when using mq. This revision also changes the test-mq-subrepo test so that on the qpop / qpush tests. We no longer use the debugsub command to check the state of the subrepos after the qpop and qpush operations. Instead we directly run the id command on the subrepos that we want to check. The reason is that using the debugsub command is misleading because it does not really check the state of the subrepos on the working directory (it just returns what the change that is specified on a given revision). Because of this the tests did not detect the problem that this revision fixes (i.e. that applying a patch did not update the subrepos to the corresponding revisions).
2013-08-13 03:38:30 +04:00
$ hg -R sub id --id
aa037b301eba
qpop
$ hg -R sub update 0000
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg qpop
abort: local changed subrepos found, refresh first
[255]
$ hg revert sub
reverting subrepo sub
adding sub/a (glob)
$ hg qpop
popping 1.diff
now at: 0.diff
$ hg status -AS
C .hgsub
C .hgsubstate
mq: update subrepos when applying / unapplying patches that change .hgsubstate Up until now applying or unapplying a patch that modified .hgsubstate would not work as expected because it would not update the subrepos according to the .hgsubstate change. This made it very easy to lose subrepo changes when using mq. This revision also changes the test-mq-subrepo test so that on the qpop / qpush tests. We no longer use the debugsub command to check the state of the subrepos after the qpop and qpush operations. Instead we directly run the id command on the subrepos that we want to check. The reason is that using the debugsub command is misleading because it does not really check the state of the subrepos on the working directory (it just returns what the change that is specified on a given revision). Because of this the tests did not detect the problem that this revision fixes (i.e. that applying a patch did not update the subrepos to the corresponding revisions). # HG changeset patch # User Angel Ezquerra <angel.ezquerra@gmail.com> # Date 1376350710 -7200 # Tue Aug 13 01:38:30 2013 +0200 # Node ID 60897e264858cdcd46f89e27a702086f08adca02 # Parent 2defb5453f223c3027eb2f7788fbddd52bbb3352 mq: update subrepos when applying / unapplying patches that change .hgsubstate Up until now applying or unapplying a patch that modified .hgsubstate would not work as expected because it would not update the subrepos according to the .hgsubstate change. This made it very easy to lose subrepo changes when using mq. This revision also changes the test-mq-subrepo test so that on the qpop / qpush tests. We no longer use the debugsub command to check the state of the subrepos after the qpop and qpush operations. Instead we directly run the id command on the subrepos that we want to check. The reason is that using the debugsub command is misleading because it does not really check the state of the subrepos on the working directory (it just returns what the change that is specified on a given revision). Because of this the tests did not detect the problem that this revision fixes (i.e. that applying a patch did not update the subrepos to the corresponding revisions).
2013-08-13 03:38:30 +04:00
C sub/a
$ hg -R sub id --id
b2fdb12cd82b
qpush
$ hg -R sub update 0000
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg qpush
abort: local changed subrepos found, refresh first
[255]
$ hg revert sub
reverting subrepo sub
adding sub/a (glob)
$ hg qpush
applying 1.diff
merge: let the user choose to merge, keep local or keep remote subrepo revisions When a subrepo has changed on the local and remote revisions, prompt the user whether it wants to merge those subrepo revisions, keep the local revision or keep the remote revision. Up until now mercurial would always perform a merge on a subrepo that had changed on the local and the remote revisions. This is often inconvenient. For example: - You may want to perform the actual subrepo merge after you have merged the parent subrepo files. - Some subrepos may be considered "read only", in the sense that you are not supposed to add new revisions to them. In those cases "merging a subrepo" means choosing which _existing_ revision you want to use on the merged revision. This is often the case for subrepos that contain binary dependencies (such as DLLs, etc). This new prompt makes mercurial better cope with those common scenarios. Notes: - The default behavior (which is the one that is used when ui is not interactive) remains unchanged (i.e. merge is the default action). - This prompt will be shown even if the ui --tool flag is set. - I don't know of a way to test the "keep local" and "keep remote" options (i.e. to force the test to choose those options). # HG changeset patch # User Angel Ezquerra <angel.ezquerra@gmail.com> # Date 1378420708 -7200 # Fri Sep 06 00:38:28 2013 +0200 # Node ID 2fb9cb0c7b26303ac3178b7739975e663075857d # Parent 796d34e1b749b79834321ef1181ed8433a5515d9 merge: let the user choose to merge, keep local or keep remote subrepo revisions When a subrepo has changed on the local and remote revisions, prompt the user whether it wants to merge those subrepo revisions, keep the local revision or keep the remote revision. Up until now mercurial would always perform a merge on a subrepo that had changed on the local and the remote revisions. This is often inconvenient. For example: - You may want to perform the actual subrepo merge after you have merged the parent subrepo files. - Some subrepos may be considered "read only", in the sense that you are not supposed to add new revisions to them. In those cases "merging a subrepo" means choosing which _existing_ revision you want to use on the merged revision. This is often the case for subrepos that contain binary dependencies (such as DLLs, etc). This new prompt makes mercurial better cope with those common scenarios. Notes: - The default behavior (which is the one that is used when ui is not interactive) remains unchanged (i.e. merge is the default action). - This prompt will be shown even if the ui --tool flag is set. - I don't know of a way to test the "keep local" and "keep remote" options (i.e. to force the test to choose those options).
2013-09-06 02:38:28 +04:00
subrepository sub diverged (local revision: b2fdb12cd82b, remote revision: aa037b301eba)
(M)erge, keep (l)ocal or keep (r)emote? m
mq: update subrepos when applying / unapplying patches that change .hgsubstate Up until now applying or unapplying a patch that modified .hgsubstate would not work as expected because it would not update the subrepos according to the .hgsubstate change. This made it very easy to lose subrepo changes when using mq. This revision also changes the test-mq-subrepo test so that on the qpop / qpush tests. We no longer use the debugsub command to check the state of the subrepos after the qpop and qpush operations. Instead we directly run the id command on the subrepos that we want to check. The reason is that using the debugsub command is misleading because it does not really check the state of the subrepos on the working directory (it just returns what the change that is specified on a given revision). Because of this the tests did not detect the problem that this revision fixes (i.e. that applying a patch did not update the subrepos to the corresponding revisions). # HG changeset patch # User Angel Ezquerra <angel.ezquerra@gmail.com> # Date 1376350710 -7200 # Tue Aug 13 01:38:30 2013 +0200 # Node ID 60897e264858cdcd46f89e27a702086f08adca02 # Parent 2defb5453f223c3027eb2f7788fbddd52bbb3352 mq: update subrepos when applying / unapplying patches that change .hgsubstate Up until now applying or unapplying a patch that modified .hgsubstate would not work as expected because it would not update the subrepos according to the .hgsubstate change. This made it very easy to lose subrepo changes when using mq. This revision also changes the test-mq-subrepo test so that on the qpop / qpush tests. We no longer use the debugsub command to check the state of the subrepos after the qpop and qpush operations. Instead we directly run the id command on the subrepos that we want to check. The reason is that using the debugsub command is misleading because it does not really check the state of the subrepos on the working directory (it just returns what the change that is specified on a given revision). Because of this the tests did not detect the problem that this revision fixes (i.e. that applying a patch did not update the subrepos to the corresponding revisions).
2013-08-13 03:38:30 +04:00
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
now at: 1.diff
$ hg status -AS
C .hgsub
mq: update subrepos when applying / unapplying patches that change .hgsubstate Up until now applying or unapplying a patch that modified .hgsubstate would not work as expected because it would not update the subrepos according to the .hgsubstate change. This made it very easy to lose subrepo changes when using mq. This revision also changes the test-mq-subrepo test so that on the qpop / qpush tests. We no longer use the debugsub command to check the state of the subrepos after the qpop and qpush operations. Instead we directly run the id command on the subrepos that we want to check. The reason is that using the debugsub command is misleading because it does not really check the state of the subrepos on the working directory (it just returns what the change that is specified on a given revision). Because of this the tests did not detect the problem that this revision fixes (i.e. that applying a patch did not update the subrepos to the corresponding revisions). # HG changeset patch # User Angel Ezquerra <angel.ezquerra@gmail.com> # Date 1376350710 -7200 # Tue Aug 13 01:38:30 2013 +0200 # Node ID 60897e264858cdcd46f89e27a702086f08adca02 # Parent 2defb5453f223c3027eb2f7788fbddd52bbb3352 mq: update subrepos when applying / unapplying patches that change .hgsubstate Up until now applying or unapplying a patch that modified .hgsubstate would not work as expected because it would not update the subrepos according to the .hgsubstate change. This made it very easy to lose subrepo changes when using mq. This revision also changes the test-mq-subrepo test so that on the qpop / qpush tests. We no longer use the debugsub command to check the state of the subrepos after the qpop and qpush operations. Instead we directly run the id command on the subrepos that we want to check. The reason is that using the debugsub command is misleading because it does not really check the state of the subrepos on the working directory (it just returns what the change that is specified on a given revision). Because of this the tests did not detect the problem that this revision fixes (i.e. that applying a patch did not update the subrepos to the corresponding revisions).
2013-08-13 03:38:30 +04:00
C .hgsubstate
C sub/a
mq: update subrepos when applying / unapplying patches that change .hgsubstate Up until now applying or unapplying a patch that modified .hgsubstate would not work as expected because it would not update the subrepos according to the .hgsubstate change. This made it very easy to lose subrepo changes when using mq. This revision also changes the test-mq-subrepo test so that on the qpop / qpush tests. We no longer use the debugsub command to check the state of the subrepos after the qpop and qpush operations. Instead we directly run the id command on the subrepos that we want to check. The reason is that using the debugsub command is misleading because it does not really check the state of the subrepos on the working directory (it just returns what the change that is specified on a given revision). Because of this the tests did not detect the problem that this revision fixes (i.e. that applying a patch did not update the subrepos to the corresponding revisions). # HG changeset patch # User Angel Ezquerra <angel.ezquerra@gmail.com> # Date 1376350710 -7200 # Tue Aug 13 01:38:30 2013 +0200 # Node ID 60897e264858cdcd46f89e27a702086f08adca02 # Parent 2defb5453f223c3027eb2f7788fbddd52bbb3352 mq: update subrepos when applying / unapplying patches that change .hgsubstate Up until now applying or unapplying a patch that modified .hgsubstate would not work as expected because it would not update the subrepos according to the .hgsubstate change. This made it very easy to lose subrepo changes when using mq. This revision also changes the test-mq-subrepo test so that on the qpop / qpush tests. We no longer use the debugsub command to check the state of the subrepos after the qpop and qpush operations. Instead we directly run the id command on the subrepos that we want to check. The reason is that using the debugsub command is misleading because it does not really check the state of the subrepos on the working directory (it just returns what the change that is specified on a given revision). Because of this the tests did not detect the problem that this revision fixes (i.e. that applying a patch did not update the subrepos to the corresponding revisions).
2013-08-13 03:38:30 +04:00
$ hg -R sub id --id
aa037b301eba
$ cd ..
handle subrepos safely on qrecord
$ mkrepo repo-2499-qrecord
$ testadd qrecord --config ui.interactive=1 -m0 0.diff <<EOF
> y
> y
> EOF
adding a
% abort when adding .hgsub w/dirty subrepo
A .hgsub
A sub/a
% qrecord --config ui.interactive=1 -m0 0.diff
diff --git a/.hgsub b/.hgsub
new file mode 100644
examine changes to '.hgsub'? [Ynesfdaq?] y
@@ -0,0 +1,1 @@
+sub = sub
record this change to '.hgsub'? [Ynesfdaq?] y
warning: subrepo spec file '.hgsub' not found
abort: uncommitted changes in subrepository 'sub'
[255]
% update substate when adding .hgsub w/clean updated subrepo
A .hgsub
% qrecord --config ui.interactive=1 -m0 0.diff
diff --git a/.hgsub b/.hgsub
new file mode 100644
examine changes to '.hgsub'? [Ynesfdaq?] y
@@ -0,0 +1,1 @@
+sub = sub
record this change to '.hgsub'? [Ynesfdaq?] y
warning: subrepo spec file '.hgsub' not found
path sub
source sub
revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
$ testmod qrecord --config ui.interactive=1 -m1 1.diff <<EOF
> y
> y
> EOF
adding a
% abort when modifying .hgsub w/dirty subrepo
M .hgsub
A sub2/a
% qrecord --config ui.interactive=1 -m1 1.diff
diff --git a/.hgsub b/.hgsub
1 hunks, 1 lines changed
examine changes to '.hgsub'? [Ynesfdaq?] y
@@ -1,1 +1,2 @@
sub = sub
+sub2 = sub2
record this change to '.hgsub'? [Ynesfdaq?] y
abort: uncommitted changes in subrepository 'sub2'
[255]
% update substate when modifying .hgsub w/clean updated subrepo
M .hgsub
% qrecord --config ui.interactive=1 -m1 1.diff
diff --git a/.hgsub b/.hgsub
1 hunks, 1 lines changed
examine changes to '.hgsub'? [Ynesfdaq?] y
@@ -1,1 +1,2 @@
sub = sub
+sub2 = sub2
record this change to '.hgsub'? [Ynesfdaq?] y
path sub
source sub
revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
path sub2
source sub2
revision 1f94c7611cc6b74f5a17b16121a1170d44776845
$ hg qpop -qa
patch queue now empty
$ testrm1 qrecord --config ui.interactive=1 -m2 2.diff <<EOF
> y
> y
> EOF
adding a
% update substate when removing .hgsub w/dirty subrepo
M sub3/a
R .hgsub
% qrecord --config ui.interactive=1 -m2 2.diff
diff --git a/.hgsub b/.hgsub
deleted file mode 100644
examine changes to '.hgsub'? [Ynesfdaq?] y
% debugsub should be empty
$ hg qpop -qa
patch queue now empty
$ testrm2 qrecord --config ui.interactive=1 -m3 3.diff <<EOF
> y
> y
> EOF
adding a
% update substate when removing .hgsub w/clean updated subrepo
R .hgsub
% qrecord --config ui.interactive=1 -m3 3.diff
diff --git a/.hgsub b/.hgsub
deleted file mode 100644
examine changes to '.hgsub'? [Ynesfdaq?] y
% debugsub should be empty
$ cd ..
correctly handle subrepos with patch queues
$ mkrepo repo-subrepo-with-queue
$ mksubrepo sub
adding a
$ hg -R sub qnew sub0.diff
$ echo sub = sub >> .hgsub
$ hg add .hgsub
$ hg qnew 0.diff
$ cd ..
check whether MQ operations can import updated .hgsubstate correctly
both into 'revision' and 'patch file under .hg/patches':
$ hg init importing-hgsubstate
$ cd importing-hgsubstate
$ echo a > a
$ hg commit -u test -d '0 0' -Am '#0 in parent'
adding a
$ hg init sub
$ echo sa > sub/sa
$ hg -R sub commit -u test -d '0 0' -Am '#0 in sub'
adding sa
$ echo 'sub = sub' > .hgsub
$ touch .hgsubstate
$ hg add .hgsub .hgsubstate
$ hg qnew -u test -d '0 0' import-at-qnew
$ hg -R sub parents --template '{node} sub\n'
b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
$ cat .hgsubstate
b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
$ hg diff -c tip
diff -r f499373e340c -r f69e96d86e75 .hgsub
--- /dev/null
+++ b/.hgsub
@@ -0,0 +1,1 @@
+sub = sub
diff -r f499373e340c -r f69e96d86e75 .hgsubstate
--- /dev/null
+++ b/.hgsubstate
@@ -0,0 +1,1 @@
+b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
$ cat .hg/patches/import-at-qnew
# HG changeset patch
# User test
# Date 0 0
# Parent f499373e340cdca5d01dee904aeb42dd2a325e71
diff -r f499373e340c -r f69e96d86e75 .hgsub
--- /dev/null
+++ b/.hgsub
@@ -0,0 +1,1 @@
+sub = sub
diff -r f499373e340c -r f69e96d86e75 .hgsubstate
--- /dev/null
+++ b/.hgsubstate
@@ -0,0 +1,1 @@
+b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
$ hg parents --template '{node}\n'
f69e96d86e75a6d4fd88285dc9697acb23951041
localrepo: omit ".hgsubstate" also from "added" files Before this patch, "localrepository.commit()" omits ".hgsubstate" from "modified" (changes[0]) and "removed" (changes[2]) file list before checking subrepositories, but leaves one in "added" (changes[1]) as it is. Then, "localrepository.commit()" adds ".hgsubstate" into "modified" or "removed" list forcibly, according to subrepository statuses. If "added" contains ".hgsubstate", the committed context will contain two ".hgsubstate" in its "files": one from "added" (not omitted one), and another from "modified" or "removed" (newly added one). How many times ".hgsubstate" appears in "files" changes node hash, even though revision content is same, because node hash calculation uses the specified "files" directly (without duplication check or so). This means that node hash of committed revision changes according to existence of ".hgsubstate" in "added" at "localrepository.commit()". ".hgsubstate" is treated as "added", not only in accidental cases, but also in the case of "qpush" for the patch adding ".hgsubstate". This patch omits ".hgsubstate" also from "added" files before checking subrepositories. This patch also omits ".hgsubstate" exclusion in "qnew"/"qrefresh" introduced by changeset bbb8109a634f, because this patch makes them meaningless. "hg parents --template '{files}\n'" newly added to "test-mq-subrepo.t" enhances checking unexpected multiple appearances of ".hgsubstate" in "files" of created/refreshed MQ revisions.
2014-03-22 18:39:51 +04:00
$ hg parents --template '{files}\n'
.hgsub .hgsubstate
check also whether qnew not including ".hgsubstate" explicitly causes
as same result (in node hash) as one including it.
$ hg qpop -a -q
patch queue now empty
$ hg qdelete import-at-qnew
$ echo 'sub = sub' > .hgsub
$ hg add .hgsub
$ rm -f .hgsubstate
$ hg qnew -u test -d '0 0' import-at-qnew
$ hg parents --template '{node}\n'
f69e96d86e75a6d4fd88285dc9697acb23951041
localrepo: omit ".hgsubstate" also from "added" files Before this patch, "localrepository.commit()" omits ".hgsubstate" from "modified" (changes[0]) and "removed" (changes[2]) file list before checking subrepositories, but leaves one in "added" (changes[1]) as it is. Then, "localrepository.commit()" adds ".hgsubstate" into "modified" or "removed" list forcibly, according to subrepository statuses. If "added" contains ".hgsubstate", the committed context will contain two ".hgsubstate" in its "files": one from "added" (not omitted one), and another from "modified" or "removed" (newly added one). How many times ".hgsubstate" appears in "files" changes node hash, even though revision content is same, because node hash calculation uses the specified "files" directly (without duplication check or so). This means that node hash of committed revision changes according to existence of ".hgsubstate" in "added" at "localrepository.commit()". ".hgsubstate" is treated as "added", not only in accidental cases, but also in the case of "qpush" for the patch adding ".hgsubstate". This patch omits ".hgsubstate" also from "added" files before checking subrepositories. This patch also omits ".hgsubstate" exclusion in "qnew"/"qrefresh" introduced by changeset bbb8109a634f, because this patch makes them meaningless. "hg parents --template '{files}\n'" newly added to "test-mq-subrepo.t" enhances checking unexpected multiple appearances of ".hgsubstate" in "files" of created/refreshed MQ revisions.
2014-03-22 18:39:51 +04:00
$ hg parents --template '{files}\n'
.hgsub .hgsubstate
check whether qrefresh imports updated .hgsubstate correctly
$ hg qpop
popping import-at-qnew
patch queue now empty
$ hg qpush
applying import-at-qnew
now at: import-at-qnew
localrepo: omit ".hgsubstate" also from "added" files Before this patch, "localrepository.commit()" omits ".hgsubstate" from "modified" (changes[0]) and "removed" (changes[2]) file list before checking subrepositories, but leaves one in "added" (changes[1]) as it is. Then, "localrepository.commit()" adds ".hgsubstate" into "modified" or "removed" list forcibly, according to subrepository statuses. If "added" contains ".hgsubstate", the committed context will contain two ".hgsubstate" in its "files": one from "added" (not omitted one), and another from "modified" or "removed" (newly added one). How many times ".hgsubstate" appears in "files" changes node hash, even though revision content is same, because node hash calculation uses the specified "files" directly (without duplication check or so). This means that node hash of committed revision changes according to existence of ".hgsubstate" in "added" at "localrepository.commit()". ".hgsubstate" is treated as "added", not only in accidental cases, but also in the case of "qpush" for the patch adding ".hgsubstate". This patch omits ".hgsubstate" also from "added" files before checking subrepositories. This patch also omits ".hgsubstate" exclusion in "qnew"/"qrefresh" introduced by changeset bbb8109a634f, because this patch makes them meaningless. "hg parents --template '{files}\n'" newly added to "test-mq-subrepo.t" enhances checking unexpected multiple appearances of ".hgsubstate" in "files" of created/refreshed MQ revisions.
2014-03-22 18:39:51 +04:00
$ hg parents --template '{files}\n'
.hgsub .hgsubstate
$ hg qnew import-at-qrefresh
$ echo sb > sub/sb
$ hg -R sub commit -u test -d '0 0' -Am '#1 in sub'
adding sb
$ hg qrefresh -u test -d '0 0'
$ hg -R sub parents --template '{node} sub\n'
88ac1bef5ed43b689d1d200b59886b675dec474b sub
$ cat .hgsubstate
88ac1bef5ed43b689d1d200b59886b675dec474b sub
$ hg diff -c tip
localrepo: omit ".hgsubstate" also from "added" files Before this patch, "localrepository.commit()" omits ".hgsubstate" from "modified" (changes[0]) and "removed" (changes[2]) file list before checking subrepositories, but leaves one in "added" (changes[1]) as it is. Then, "localrepository.commit()" adds ".hgsubstate" into "modified" or "removed" list forcibly, according to subrepository statuses. If "added" contains ".hgsubstate", the committed context will contain two ".hgsubstate" in its "files": one from "added" (not omitted one), and another from "modified" or "removed" (newly added one). How many times ".hgsubstate" appears in "files" changes node hash, even though revision content is same, because node hash calculation uses the specified "files" directly (without duplication check or so). This means that node hash of committed revision changes according to existence of ".hgsubstate" in "added" at "localrepository.commit()". ".hgsubstate" is treated as "added", not only in accidental cases, but also in the case of "qpush" for the patch adding ".hgsubstate". This patch omits ".hgsubstate" also from "added" files before checking subrepositories. This patch also omits ".hgsubstate" exclusion in "qnew"/"qrefresh" introduced by changeset bbb8109a634f, because this patch makes them meaningless. "hg parents --template '{files}\n'" newly added to "test-mq-subrepo.t" enhances checking unexpected multiple appearances of ".hgsubstate" in "files" of created/refreshed MQ revisions.
2014-03-22 18:39:51 +04:00
diff -r 05b056bb9c8c -r d987bec230f4 .hgsubstate
--- a/.hgsubstate
+++ b/.hgsubstate
@@ -1,1 +1,1 @@
-b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
+88ac1bef5ed43b689d1d200b59886b675dec474b sub
$ cat .hg/patches/import-at-qrefresh
# HG changeset patch
# User test
# Date 0 0
# Parent 05b056bb9c8c05ff15258b84fd42ab3527271033
localrepo: omit ".hgsubstate" also from "added" files Before this patch, "localrepository.commit()" omits ".hgsubstate" from "modified" (changes[0]) and "removed" (changes[2]) file list before checking subrepositories, but leaves one in "added" (changes[1]) as it is. Then, "localrepository.commit()" adds ".hgsubstate" into "modified" or "removed" list forcibly, according to subrepository statuses. If "added" contains ".hgsubstate", the committed context will contain two ".hgsubstate" in its "files": one from "added" (not omitted one), and another from "modified" or "removed" (newly added one). How many times ".hgsubstate" appears in "files" changes node hash, even though revision content is same, because node hash calculation uses the specified "files" directly (without duplication check or so). This means that node hash of committed revision changes according to existence of ".hgsubstate" in "added" at "localrepository.commit()". ".hgsubstate" is treated as "added", not only in accidental cases, but also in the case of "qpush" for the patch adding ".hgsubstate". This patch omits ".hgsubstate" also from "added" files before checking subrepositories. This patch also omits ".hgsubstate" exclusion in "qnew"/"qrefresh" introduced by changeset bbb8109a634f, because this patch makes them meaningless. "hg parents --template '{files}\n'" newly added to "test-mq-subrepo.t" enhances checking unexpected multiple appearances of ".hgsubstate" in "files" of created/refreshed MQ revisions.
2014-03-22 18:39:51 +04:00
diff -r 05b056bb9c8c .hgsubstate
--- a/.hgsubstate
+++ b/.hgsubstate
@@ -1,1 +1,1 @@
-b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
+88ac1bef5ed43b689d1d200b59886b675dec474b sub
localrepo: omit ".hgsubstate" also from "added" files Before this patch, "localrepository.commit()" omits ".hgsubstate" from "modified" (changes[0]) and "removed" (changes[2]) file list before checking subrepositories, but leaves one in "added" (changes[1]) as it is. Then, "localrepository.commit()" adds ".hgsubstate" into "modified" or "removed" list forcibly, according to subrepository statuses. If "added" contains ".hgsubstate", the committed context will contain two ".hgsubstate" in its "files": one from "added" (not omitted one), and another from "modified" or "removed" (newly added one). How many times ".hgsubstate" appears in "files" changes node hash, even though revision content is same, because node hash calculation uses the specified "files" directly (without duplication check or so). This means that node hash of committed revision changes according to existence of ".hgsubstate" in "added" at "localrepository.commit()". ".hgsubstate" is treated as "added", not only in accidental cases, but also in the case of "qpush" for the patch adding ".hgsubstate". This patch omits ".hgsubstate" also from "added" files before checking subrepositories. This patch also omits ".hgsubstate" exclusion in "qnew"/"qrefresh" introduced by changeset bbb8109a634f, because this patch makes them meaningless. "hg parents --template '{files}\n'" newly added to "test-mq-subrepo.t" enhances checking unexpected multiple appearances of ".hgsubstate" in "files" of created/refreshed MQ revisions.
2014-03-22 18:39:51 +04:00
$ hg parents --template '{files}\n'
.hgsubstate
$ hg qrefresh -u test -d '0 0'
$ cat .hgsubstate
88ac1bef5ed43b689d1d200b59886b675dec474b sub
$ hg diff -c tip
localrepo: omit ".hgsubstate" also from "added" files Before this patch, "localrepository.commit()" omits ".hgsubstate" from "modified" (changes[0]) and "removed" (changes[2]) file list before checking subrepositories, but leaves one in "added" (changes[1]) as it is. Then, "localrepository.commit()" adds ".hgsubstate" into "modified" or "removed" list forcibly, according to subrepository statuses. If "added" contains ".hgsubstate", the committed context will contain two ".hgsubstate" in its "files": one from "added" (not omitted one), and another from "modified" or "removed" (newly added one). How many times ".hgsubstate" appears in "files" changes node hash, even though revision content is same, because node hash calculation uses the specified "files" directly (without duplication check or so). This means that node hash of committed revision changes according to existence of ".hgsubstate" in "added" at "localrepository.commit()". ".hgsubstate" is treated as "added", not only in accidental cases, but also in the case of "qpush" for the patch adding ".hgsubstate". This patch omits ".hgsubstate" also from "added" files before checking subrepositories. This patch also omits ".hgsubstate" exclusion in "qnew"/"qrefresh" introduced by changeset bbb8109a634f, because this patch makes them meaningless. "hg parents --template '{files}\n'" newly added to "test-mq-subrepo.t" enhances checking unexpected multiple appearances of ".hgsubstate" in "files" of created/refreshed MQ revisions.
2014-03-22 18:39:51 +04:00
diff -r 05b056bb9c8c -r d987bec230f4 .hgsubstate
--- a/.hgsubstate
+++ b/.hgsubstate
@@ -1,1 +1,1 @@
-b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
+88ac1bef5ed43b689d1d200b59886b675dec474b sub
$ cat .hg/patches/import-at-qrefresh
# HG changeset patch
# User test
# Date 0 0
# Parent 05b056bb9c8c05ff15258b84fd42ab3527271033
localrepo: omit ".hgsubstate" also from "added" files Before this patch, "localrepository.commit()" omits ".hgsubstate" from "modified" (changes[0]) and "removed" (changes[2]) file list before checking subrepositories, but leaves one in "added" (changes[1]) as it is. Then, "localrepository.commit()" adds ".hgsubstate" into "modified" or "removed" list forcibly, according to subrepository statuses. If "added" contains ".hgsubstate", the committed context will contain two ".hgsubstate" in its "files": one from "added" (not omitted one), and another from "modified" or "removed" (newly added one). How many times ".hgsubstate" appears in "files" changes node hash, even though revision content is same, because node hash calculation uses the specified "files" directly (without duplication check or so). This means that node hash of committed revision changes according to existence of ".hgsubstate" in "added" at "localrepository.commit()". ".hgsubstate" is treated as "added", not only in accidental cases, but also in the case of "qpush" for the patch adding ".hgsubstate". This patch omits ".hgsubstate" also from "added" files before checking subrepositories. This patch also omits ".hgsubstate" exclusion in "qnew"/"qrefresh" introduced by changeset bbb8109a634f, because this patch makes them meaningless. "hg parents --template '{files}\n'" newly added to "test-mq-subrepo.t" enhances checking unexpected multiple appearances of ".hgsubstate" in "files" of created/refreshed MQ revisions.
2014-03-22 18:39:51 +04:00
diff -r 05b056bb9c8c .hgsubstate
--- a/.hgsubstate
+++ b/.hgsubstate
@@ -1,1 +1,1 @@
-b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
+88ac1bef5ed43b689d1d200b59886b675dec474b sub
localrepo: omit ".hgsubstate" also from "added" files Before this patch, "localrepository.commit()" omits ".hgsubstate" from "modified" (changes[0]) and "removed" (changes[2]) file list before checking subrepositories, but leaves one in "added" (changes[1]) as it is. Then, "localrepository.commit()" adds ".hgsubstate" into "modified" or "removed" list forcibly, according to subrepository statuses. If "added" contains ".hgsubstate", the committed context will contain two ".hgsubstate" in its "files": one from "added" (not omitted one), and another from "modified" or "removed" (newly added one). How many times ".hgsubstate" appears in "files" changes node hash, even though revision content is same, because node hash calculation uses the specified "files" directly (without duplication check or so). This means that node hash of committed revision changes according to existence of ".hgsubstate" in "added" at "localrepository.commit()". ".hgsubstate" is treated as "added", not only in accidental cases, but also in the case of "qpush" for the patch adding ".hgsubstate". This patch omits ".hgsubstate" also from "added" files before checking subrepositories. This patch also omits ".hgsubstate" exclusion in "qnew"/"qrefresh" introduced by changeset bbb8109a634f, because this patch makes them meaningless. "hg parents --template '{files}\n'" newly added to "test-mq-subrepo.t" enhances checking unexpected multiple appearances of ".hgsubstate" in "files" of created/refreshed MQ revisions.
2014-03-22 18:39:51 +04:00
$ hg parents --template '{files}\n'
.hgsubstate
$ 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
2012-09-11 19:36:09 +04:00
$ hg commit -Am '#2 in parent (but will be rolled back 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
# User test
# Date 0 0
# Parent 4d91eb2fa1d1b22ec513347b9cd06f6b49d470fa
diff -r 4d91eb2fa1d1 -r 1259c112d884 .hgsubstate
--- a/.hgsubstate
+++ b/.hgsubstate
@@ -1,1 +1,1 @@
-b6f6e9c41f3dfd374a6d2ed4535c87951cf979cf sub
+88ac1bef5ed43b689d1d200b59886b675dec474b sub
localrepo: omit ".hgsubstate" also from "added" files Before this patch, "localrepository.commit()" omits ".hgsubstate" from "modified" (changes[0]) and "removed" (changes[2]) file list before checking subrepositories, but leaves one in "added" (changes[1]) as it is. Then, "localrepository.commit()" adds ".hgsubstate" into "modified" or "removed" list forcibly, according to subrepository statuses. If "added" contains ".hgsubstate", the committed context will contain two ".hgsubstate" in its "files": one from "added" (not omitted one), and another from "modified" or "removed" (newly added one). How many times ".hgsubstate" appears in "files" changes node hash, even though revision content is same, because node hash calculation uses the specified "files" directly (without duplication check or so). This means that node hash of committed revision changes according to existence of ".hgsubstate" in "added" at "localrepository.commit()". ".hgsubstate" is treated as "added", not only in accidental cases, but also in the case of "qpush" for the patch adding ".hgsubstate". This patch omits ".hgsubstate" also from "added" files before checking subrepositories. This patch also omits ".hgsubstate" exclusion in "qnew"/"qrefresh" introduced by changeset bbb8109a634f, because this patch makes them meaningless. "hg parents --template '{files}\n'" newly added to "test-mq-subrepo.t" enhances checking unexpected multiple appearances of ".hgsubstate" in "files" of created/refreshed MQ revisions.
2014-03-22 18:39:51 +04:00
$ hg parents --template '{files}\n'
.hgsubstate
check whether qrefresh not including ".hgsubstate" explicitly causes
as same result (in node hash) as one including it.
$ hg update -C -q 0
$ hg qpop -a -q
patch queue now empty
$ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh
$ echo 'sub = sub' > .hgsub
$ echo > .hgsubstate
$ hg add .hgsub .hgsubstate
$ hg qrefresh -u test -d '0 0'
$ hg parents --template '{node}\n'
7c48c35501aae6770ed9c2517014628615821a8e
localrepo: omit ".hgsubstate" also from "added" files Before this patch, "localrepository.commit()" omits ".hgsubstate" from "modified" (changes[0]) and "removed" (changes[2]) file list before checking subrepositories, but leaves one in "added" (changes[1]) as it is. Then, "localrepository.commit()" adds ".hgsubstate" into "modified" or "removed" list forcibly, according to subrepository statuses. If "added" contains ".hgsubstate", the committed context will contain two ".hgsubstate" in its "files": one from "added" (not omitted one), and another from "modified" or "removed" (newly added one). How many times ".hgsubstate" appears in "files" changes node hash, even though revision content is same, because node hash calculation uses the specified "files" directly (without duplication check or so). This means that node hash of committed revision changes according to existence of ".hgsubstate" in "added" at "localrepository.commit()". ".hgsubstate" is treated as "added", not only in accidental cases, but also in the case of "qpush" for the patch adding ".hgsubstate". This patch omits ".hgsubstate" also from "added" files before checking subrepositories. This patch also omits ".hgsubstate" exclusion in "qnew"/"qrefresh" introduced by changeset bbb8109a634f, because this patch makes them meaningless. "hg parents --template '{files}\n'" newly added to "test-mq-subrepo.t" enhances checking unexpected multiple appearances of ".hgsubstate" in "files" of created/refreshed MQ revisions.
2014-03-22 18:39:51 +04:00
$ hg parents --template '{files}\n'
.hgsub .hgsubstate
$ hg qpop -a -q
patch queue now empty
$ hg qdelete add-hgsub-at-qrefresh
$ hg qnew -u test -d '0 0' add-hgsub-at-qrefresh
$ echo 'sub = sub' > .hgsub
$ hg add .hgsub
$ rm -f .hgsubstate
$ hg qrefresh -u test -d '0 0'
$ hg parents --template '{node}\n'
7c48c35501aae6770ed9c2517014628615821a8e
localrepo: omit ".hgsubstate" also from "added" files Before this patch, "localrepository.commit()" omits ".hgsubstate" from "modified" (changes[0]) and "removed" (changes[2]) file list before checking subrepositories, but leaves one in "added" (changes[1]) as it is. Then, "localrepository.commit()" adds ".hgsubstate" into "modified" or "removed" list forcibly, according to subrepository statuses. If "added" contains ".hgsubstate", the committed context will contain two ".hgsubstate" in its "files": one from "added" (not omitted one), and another from "modified" or "removed" (newly added one). How many times ".hgsubstate" appears in "files" changes node hash, even though revision content is same, because node hash calculation uses the specified "files" directly (without duplication check or so). This means that node hash of committed revision changes according to existence of ".hgsubstate" in "added" at "localrepository.commit()". ".hgsubstate" is treated as "added", not only in accidental cases, but also in the case of "qpush" for the patch adding ".hgsubstate". This patch omits ".hgsubstate" also from "added" files before checking subrepositories. This patch also omits ".hgsubstate" exclusion in "qnew"/"qrefresh" introduced by changeset bbb8109a634f, because this patch makes them meaningless. "hg parents --template '{files}\n'" newly added to "test-mq-subrepo.t" enhances checking unexpected multiple appearances of ".hgsubstate" in "files" of created/refreshed MQ revisions.
2014-03-22 18:39:51 +04:00
$ hg parents --template '{files}\n'
.hgsub .hgsubstate
$ cd ..
$ cd ..