comparison tests/test-mq-subrepo.t @ 20785:7f7c8ef31c5d

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()".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Thu, 20 Mar 2014 00:10:45 +0900
parents 5e10d41e7b9c
children d666da075b91
comparison
equal deleted inserted replaced
20783:43054dc84abd 20785:7f7c8ef31c5d
92 92
93 93
94 handle subrepos safely on qnew 94 handle subrepos safely on qnew
95 95
96 $ mkrepo repo-2499-qnew 96 $ mkrepo repo-2499-qnew
97 $ testadd qnew -m0 0.diff 97 $ testadd qnew -X path:no-effect -m0 0.diff
98 adding a 98 adding a
99 % abort when adding .hgsub w/dirty subrepo 99 % abort when adding .hgsub w/dirty subrepo
100 A .hgsub 100 A .hgsub
101 A sub/a 101 A sub/a
102 % qnew -m0 0.diff 102 % qnew -X path:no-effect -m0 0.diff
103 abort: uncommitted changes in subrepository sub 103 abort: uncommitted changes in subrepository sub
104 [255] 104 [255]
105 % update substate when adding .hgsub w/clean updated subrepo 105 % update substate when adding .hgsub w/clean updated subrepo
106 A .hgsub 106 A .hgsub
107 % qnew -m0 0.diff 107 % qnew -X path:no-effect -m0 0.diff
108 path sub 108 path sub
109 source sub 109 source sub
110 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31 110 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
111 111
112 $ testmod qnew -m1 1.diff 112 $ testmod qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
113 adding a 113 adding a
114 % abort when modifying .hgsub w/dirty subrepo 114 % abort when modifying .hgsub w/dirty subrepo
115 M .hgsub 115 M .hgsub
116 A sub2/a 116 A sub2/a
117 % qnew -m1 1.diff 117 % qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
118 abort: uncommitted changes in subrepository sub2 118 abort: uncommitted changes in subrepository sub2
119 [255] 119 [255]
120 % update substate when modifying .hgsub w/clean updated subrepo 120 % update substate when modifying .hgsub w/clean updated subrepo
121 M .hgsub 121 M .hgsub
122 % qnew -m1 1.diff 122 % qnew --cwd .. -R repo-2499-qnew -X path:no-effect -m1 1.diff
123 path sub 123 path sub
124 source sub 124 source sub
125 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31 125 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
126 path sub2 126 path sub2
127 source sub2 127 source sub2