##// END OF EJS Templates
subrepo: rewrite handling of subrepo state at commit (issue2403)...
Matt Mackall -
r16073:b254f827 default
parent child Browse files
Show More
@@ -1096,37 +1096,58 b' class localrepository(repo.repository):'
1096
1096
1097 # check subrepos
1097 # check subrepos
1098 subs = []
1098 subs = []
1099 removedsubs = set()
1099 commitsubs = set()
1100 newstate = wctx.substate.copy()
1101 # only manage subrepos and .hgsubstate if .hgsub is present
1100 if '.hgsub' in wctx:
1102 if '.hgsub' in wctx:
1101 # only manage subrepos and .hgsubstate if .hgsub is present
1103 # we'll decide whether to track this ourselves, thanks
1104 if '.hgsubstate' in changes[0]:
1105 changes[0].remove('.hgsubstate')
1106 if '.hgsubstate' in changes[2]:
1107 changes[2].remove('.hgsubstate')
1108
1109 # compare current state to last committed state
1110 # build new substate based on last committed state
1111 oldstate = wctx.p1().substate
1112 for s in sorted(newstate.keys()):
1113 if not match(s):
1114 # ignore working copy, use old state if present
1115 if s in oldstate:
1116 newstate[s] = oldstate[s]
1117 continue
1118 if not force:
1119 raise util.Abort(
1120 _("commit with new subrepo %s excluded") % s)
1121 if wctx.sub(s).dirty(True):
1122 if not self.ui.configbool('ui', 'commitsubrepos'):
1123 raise util.Abort(
1124 _("uncommitted changes in subrepo %s") % s,
1125 hint=_("use --subrepos for recursive commit"))
1126 subs.append(s)
1127 commitsubs.add(s)
1128 else:
1129 bs = wctx.sub(s).basestate()
1130 newstate[s] = (newstate[s][0], bs, newstate[s][2])
1131 if oldstate.get(s, (None, None, None))[1] != bs:
1132 subs.append(s)
1133
1134 # check for removed subrepos
1102 for p in wctx.parents():
1135 for p in wctx.parents():
1103 removedsubs.update(s for s in p.substate if match(s))
1136 r = [s for s in p.substate if s not in newstate]
1104 for s in wctx.substate:
1137 subs += [s for s in r if match(s)]
1105 removedsubs.discard(s)
1138 if subs:
1106 if match(s) and wctx.sub(s).dirty():
1107 subs.append(s)
1108 if (subs or removedsubs):
1109 if (not match('.hgsub') and
1139 if (not match('.hgsub') and
1110 '.hgsub' in (wctx.modified() + wctx.added())):
1140 '.hgsub' in (wctx.modified() + wctx.added())):
1111 raise util.Abort(
1141 raise util.Abort(
1112 _("can't commit subrepos without .hgsub"))
1142 _("can't commit subrepos without .hgsub"))
1113 if '.hgsubstate' not in changes[0]:
1143 changes[0].insert(0, '.hgsubstate')
1114 changes[0].insert(0, '.hgsubstate')
1144
1115 if '.hgsubstate' in changes[2]:
1116 changes[2].remove('.hgsubstate')
1117 elif '.hgsub' in changes[2]:
1145 elif '.hgsub' in changes[2]:
1118 # clean up .hgsubstate when .hgsub is removed
1146 # clean up .hgsubstate when .hgsub is removed
1119 if ('.hgsubstate' in wctx and
1147 if ('.hgsubstate' in wctx and
1120 '.hgsubstate' not in changes[0] + changes[1] + changes[2]):
1148 '.hgsubstate' not in changes[0] + changes[1] + changes[2]):
1121 changes[2].insert(0, '.hgsubstate')
1149 changes[2].insert(0, '.hgsubstate')
1122
1150
1123 if subs and not self.ui.configbool('ui', 'commitsubrepos', False):
1124 changedsubs = [s for s in subs if wctx.sub(s).dirty(True)]
1125 if changedsubs:
1126 raise util.Abort(_("uncommitted changes in subrepo %s")
1127 % changedsubs[0],
1128 hint=_("use --subrepos for recursive commit"))
1129
1130 # make sure all explicit patterns are matched
1151 # make sure all explicit patterns are matched
1131 if not force and match.files():
1152 if not force and match.files():
1132 matched = set(changes[0] + changes[1] + changes[2])
1153 matched = set(changes[0] + changes[1] + changes[2])
@@ -1162,16 +1183,15 b' class localrepository(repo.repository):'
1162 cctx._text = editor(self, cctx, subs)
1183 cctx._text = editor(self, cctx, subs)
1163 edited = (text != cctx._text)
1184 edited = (text != cctx._text)
1164
1185
1165 # commit subs
1186 # commit subs and write new state
1166 if subs or removedsubs:
1187 if subs:
1167 state = wctx.substate.copy()
1188 for s in sorted(commitsubs):
1168 for s in sorted(subs):
1169 sub = wctx.sub(s)
1189 sub = wctx.sub(s)
1170 self.ui.status(_('committing subrepository %s\n') %
1190 self.ui.status(_('committing subrepository %s\n') %
1171 subrepo.subrelpath(sub))
1191 subrepo.subrelpath(sub))
1172 sr = sub.commit(cctx._text, user, date)
1192 sr = sub.commit(cctx._text, user, date)
1173 state[s] = (state[s][0], sr)
1193 newstate[s] = (newstate[s][0], sr)
1174 subrepo.writestate(self, state)
1194 subrepo.writestate(self, newstate)
1175
1195
1176 # Save commit message in case this transaction gets rolled back
1196 # Save commit message in case this transaction gets rolled back
1177 # (e.g. by a pretxncommit hook). Leave the content alone on
1197 # (e.g. by a pretxncommit hook). Leave the content alone on
@@ -474,9 +474,6 b''
474 > except:
474 > except:
475 warning: naked except clause
475 warning: naked except clause
476 mercurial/localrepo.py:0:
476 mercurial/localrepo.py:0:
477 > hint=_("use --subrepos for recursive commit"))
478 warning: line over 80 characters
479 mercurial/localrepo.py:0:
480 > # we return an integer indicating remote head count change
477 > # we return an integer indicating remote head count change
481 warning: line over 80 characters
478 warning: line over 80 characters
482 mercurial/localrepo.py:0:
479 mercurial/localrepo.py:0:
@@ -37,7 +37,6 b' qnew on repo w/svn subrepo'
37 $ hg status -S -X '**/format'
37 $ hg status -S -X '**/format'
38 A .hgsub
38 A .hgsub
39 $ hg qnew -m0 0.diff
39 $ hg qnew -m0 0.diff
40 committing subrepository sub
41 $ cd sub
40 $ cd sub
42 $ echo a > a
41 $ echo a > a
43 $ svn add a
42 $ svn add a
@@ -105,7 +105,6 b' handle subrepos safely on qnew'
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 -m0 0.diff
108 committing subrepository sub
109 path sub
108 path sub
110 source sub
109 source sub
111 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
110 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
@@ -121,7 +120,6 b' handle subrepos safely on qnew'
121 % update substate when modifying .hgsub w/clean updated subrepo
120 % update substate when modifying .hgsub w/clean updated subrepo
122 M .hgsub
121 M .hgsub
123 % qnew -m1 1.diff
122 % qnew -m1 1.diff
124 committing subrepository sub2
125 path sub
123 path sub
126 source sub
124 source sub
127 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
125 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
@@ -166,7 +164,6 b' handle subrepos safely on qrefresh'
166 % update substate when adding .hgsub w/clean updated subrepo
164 % update substate when adding .hgsub w/clean updated subrepo
167 A .hgsub
165 A .hgsub
168 % qrefresh
166 % qrefresh
169 committing subrepository sub
170 path sub
167 path sub
171 source sub
168 source sub
172 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
169 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
@@ -183,7 +180,6 b' handle subrepos safely on qrefresh'
183 % update substate when modifying .hgsub w/clean updated subrepo
180 % update substate when modifying .hgsub w/clean updated subrepo
184 M .hgsub
181 M .hgsub
185 % qrefresh
182 % qrefresh
186 committing subrepository sub2
187 path sub
183 path sub
188 source sub
184 source sub
189 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
185 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
@@ -225,7 +221,6 b' handle subrepos safely on qpush/qpop'
225 $ echo sub = sub > .hgsub
221 $ echo sub = sub > .hgsub
226 $ hg add .hgsub
222 $ hg add .hgsub
227 $ hg qnew -m0 0.diff
223 $ hg qnew -m0 0.diff
228 committing subrepository sub
229 $ hg debugsub
224 $ hg debugsub
230 path sub
225 path sub
231 source sub
226 source sub
@@ -277,7 +272,6 b' handle subrepos safely on qrecord'
277 diff --git a/.hgsub b/.hgsub
272 diff --git a/.hgsub b/.hgsub
278 new file mode 100644
273 new file mode 100644
279 examine changes to '.hgsub'? [Ynsfdaq?]
274 examine changes to '.hgsub'? [Ynsfdaq?]
280 committing subrepository sub
281 path sub
275 path sub
282 source sub
276 source sub
283 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
277 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
@@ -310,7 +304,6 b' handle subrepos safely on qrecord'
310 sub = sub
304 sub = sub
311 +sub2 = sub2
305 +sub2 = sub2
312 record this change to '.hgsub'? [Ynsfdaq?]
306 record this change to '.hgsub'? [Ynsfdaq?]
313 committing subrepository sub2
314 path sub
307 path sub
315 source sub
308 source sub
316 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
309 revision b2fdb12cd82b021c3b7053d67802e77b6eeaee31
@@ -360,4 +353,3 b' correctly handle subrepos with patch que'
360 $ echo sub = sub >> .hgsub
353 $ echo sub = sub >> .hgsub
361 $ hg add .hgsub
354 $ hg add .hgsub
362 $ hg qnew 0.diff
355 $ hg qnew 0.diff
363 committing subrepository sub
@@ -18,7 +18,6 b" Preparing the 'sub1' repo which depends "
18 adding sub1/.hgsub (glob)
18 adding sub1/.hgsub (glob)
19 adding sub1/sub1 (glob)
19 adding sub1/sub1 (glob)
20 $ hg commit -R sub1 -m "sub1 import"
20 $ hg commit -R sub1 -m "sub1 import"
21 committing subrepository sub2
22
21
23 Preparing the 'main' repo which depends on the subrepo 'sub1'
22 Preparing the 'main' repo which depends on the subrepo 'sub1'
24
23
@@ -33,7 +32,6 b" Preparing the 'main' repo which depends "
33 adding main/.hgsub (glob)
32 adding main/.hgsub (glob)
34 adding main/main (glob)
33 adding main/main (glob)
35 $ hg commit -R main -m "main import"
34 $ hg commit -R main -m "main import"
36 committing subrepository sub1
37
35
38 Cleaning both repositories, just as a clone -U
36 Cleaning both repositories, just as a clone -U
39
37
@@ -34,7 +34,6 b' add subrepo clone'
34 $ git clone -q ../gitroot s
34 $ git clone -q ../gitroot s
35 $ hg add .hgsub
35 $ hg add .hgsub
36 $ hg commit -m 'new git subrepo'
36 $ hg commit -m 'new git subrepo'
37 committing subrepository s
38 $ hg debugsub
37 $ hg debugsub
39 path s
38 path s
40 source ../gitroot
39 source ../gitroot
@@ -55,7 +54,6 b' record a new commit from upstream from a'
55 $ hg status --subrepos
54 $ hg status --subrepos
56 M s/g
55 M s/g
57 $ hg commit -m 'update git subrepo'
56 $ hg commit -m 'update git subrepo'
58 committing subrepository s
59 $ hg debugsub
57 $ hg debugsub
60 path s
58 path s
61 source ../gitroot
59 source ../gitroot
@@ -222,7 +220,6 b' sync to upstream git, distribute changes'
222 $ git pull -q >/dev/null 2>/dev/null
220 $ git pull -q >/dev/null 2>/dev/null
223 $ cd ..
221 $ cd ..
224 $ hg commit -m 'git upstream sync'
222 $ hg commit -m 'git upstream sync'
225 committing subrepository s
226 $ hg debugsub
223 $ hg debugsub
227 path s
224 path s
228 source ../gitroot
225 source ../gitroot
@@ -287,7 +284,6 b' create nested repo'
287 $ echo inner = inner > .hgsub
284 $ echo inner = inner > .hgsub
288 $ hg add .hgsub
285 $ hg add .hgsub
289 $ hg commit -m 'nested sub'
286 $ hg commit -m 'nested sub'
290 committing subrepository inner
291
287
292 nested commit
288 nested commit
293
289
@@ -339,27 +335,32 b" Don't crash if the .hgsubstate entry is "
339 $ hg update 1 -q
335 $ hg update 1 -q
340 $ hg rm .hgsubstate
336 $ hg rm .hgsubstate
341 $ hg commit .hgsubstate -m 'no substate'
337 $ hg commit .hgsubstate -m 'no substate'
342 created new head
338 nothing changed
339 [1]
343 $ hg tag -l nosubstate
340 $ hg tag -l nosubstate
344 $ hg manifest
341 $ hg manifest
345 .hgsub
342 .hgsub
343 .hgsubstate
346 a
344 a
347
345
348 $ hg status -S
346 $ hg status -S
347 R .hgsubstate
349 $ hg sum | grep commit
348 $ hg sum | grep commit
350 commit: 1 subrepos
349 commit: 1 removed, 1 subrepos (new branch head)
351
350
352 $ hg commit -m 'restore substate'
351 $ hg commit -m 'restore substate'
353 committing subrepository s
352 nothing changed
353 [1]
354 $ hg manifest
354 $ hg manifest
355 .hgsub
355 .hgsub
356 .hgsubstate
356 .hgsubstate
357 a
357 a
358 $ hg sum | grep commit
358 $ hg sum | grep commit
359 commit: (clean)
359 commit: 1 removed, 1 subrepos (new branch head)
360
360
361 $ hg update -qC nosubstate
361 $ hg update -qC nosubstate
362 $ ls s
362 $ ls s
363 g
363
364
364 issue3109: false positives in git diff-index
365 issue3109: false positives in git diff-index
365
366
@@ -7,12 +7,10 b''
7 $ echo 'subrepo = subrepo' > .hgsub
7 $ echo 'subrepo = subrepo' > .hgsub
8 $ hg ci -Am addsubrepo
8 $ hg ci -Am addsubrepo
9 adding .hgsub
9 adding .hgsub
10 committing subrepository subrepo
11 $ echo b > subrepo/b
10 $ echo b > subrepo/b
12 $ hg -R subrepo ci -Am addb
11 $ hg -R subrepo ci -Am addb
13 adding b
12 adding b
14 $ hg ci -m updatedsub
13 $ hg ci -m updatedsub
15 committing subrepository subrepo
16
14
17 delete .hgsub and revert it
15 delete .hgsub and revert it
18
16
@@ -79,11 +79,9 b' The --subrepos flag overwrite the config'
79
79
80 $ cd ..
80 $ cd ..
81 $ hg commit -m 0-2-1
81 $ hg commit -m 0-2-1
82 committing subrepository bar
83
82
84 $ cd ..
83 $ cd ..
85 $ hg commit -m 1-2-1
84 $ hg commit -m 1-2-1
86 committing subrepository foo
87
85
88 Change working directory:
86 Change working directory:
89
87
@@ -20,7 +20,6 b" Preparing the 'main' repo which depends "
20 adding main/.hgsub (glob)
20 adding main/.hgsub (glob)
21 adding main/main (glob)
21 adding main/main (glob)
22 $ hg commit -R main -m "main import"
22 $ hg commit -R main -m "main import"
23 committing subrepository sub
24
23
25 Cleaning both repositories, just as a clone -U
24 Cleaning both repositories, just as a clone -U
26
25
@@ -69,8 +69,6 b' add first svn sub with leading whitespac'
69 $ svn co --quiet "$SVNREPO"/src subdir/s
69 $ svn co --quiet "$SVNREPO"/src subdir/s
70 $ hg add .hgsub
70 $ hg add .hgsub
71 $ hg ci -m1
71 $ hg ci -m1
72 committing subrepository s
73 committing subrepository subdir/s
74
72
75 make sure we avoid empty commits (issue2445)
73 make sure we avoid empty commits (issue2445)
76
74
@@ -432,7 +430,6 b' are unknown directories being replaced b'
432 $ echo "s = [svn] $SVNREPO/src" >> .hgsub
430 $ echo "s = [svn] $SVNREPO/src" >> .hgsub
433 $ hg add .hgsub
431 $ hg add .hgsub
434 $ hg ci -m addsub
432 $ hg ci -m addsub
435 committing subrepository s
436 $ echo a > a
433 $ echo a > a
437 $ hg ci -Am adda
434 $ hg ci -Am adda
438 adding a
435 adding a
@@ -440,7 +437,6 b' are unknown directories being replaced b'
440 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
437 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
441 $ svn up -qr6 s
438 $ svn up -qr6 s
442 $ hg ci -m updatesub
439 $ hg ci -m updatesub
443 committing subrepository s
444 created new head
440 created new head
445 $ echo pyc > s/dir/epsilon.pyc
441 $ echo pyc > s/dir/epsilon.pyc
446 $ hg up 1
442 $ hg up 1
@@ -462,14 +458,12 b' test having obstructions when switching '
462 $ echo "obstruct = [svn] $SVNREPO/externals" >> .hgsub
458 $ echo "obstruct = [svn] $SVNREPO/externals" >> .hgsub
463 $ svn co -r5 --quiet "$SVNREPO"/externals obstruct
459 $ svn co -r5 --quiet "$SVNREPO"/externals obstruct
464 $ hg commit -m 'Start making obstructed working copy'
460 $ hg commit -m 'Start making obstructed working copy'
465 committing subrepository obstruct
466 $ hg book other
461 $ hg book other
467 $ hg co -r 'p1(tip)'
462 $ hg co -r 'p1(tip)'
468 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
463 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
469 $ echo "obstruct = [svn] $SVNREPO/src" >> .hgsub
464 $ echo "obstruct = [svn] $SVNREPO/src" >> .hgsub
470 $ svn co -r5 --quiet "$SVNREPO"/src obstruct
465 $ svn co -r5 --quiet "$SVNREPO"/src obstruct
471 $ hg commit -m 'Other branch which will be obstructed'
466 $ hg commit -m 'Other branch which will be obstructed'
472 committing subrepository obstruct
473 created new head
467 created new head
474
468
475 Switching back to the head where we have another path mapped to the
469 Switching back to the head where we have another path mapped to the
@@ -530,12 +524,10 b' First, create that condition in the repo'
530 Checked out revision 10.
524 Checked out revision 10.
531 $ echo "recreated = [svn] $SVNREPO/branch" >> .hgsub
525 $ echo "recreated = [svn] $SVNREPO/branch" >> .hgsub
532 $ hg ci -m addsub
526 $ hg ci -m addsub
533 committing subrepository recreated
534 $ cd recreated
527 $ cd recreated
535 $ svn up -q
528 $ svn up -q
536 $ cd ..
529 $ cd ..
537 $ hg ci -m updatesub
530 $ hg ci -m updatesub
538 committing subrepository recreated
539 $ hg up -r-2
531 $ hg up -r-2
540 D *recreated/somethingnew (glob)
532 D *recreated/somethingnew (glob)
541 A *recreated/somethingold (glob)
533 A *recreated/somethingold (glob)
@@ -37,7 +37,6 b' Issue2232: committing a subrepo without '
37 commit: 1 added, 1 subrepos
37 commit: 1 added, 1 subrepos
38 update: (current)
38 update: (current)
39 $ hg ci -m1
39 $ hg ci -m1
40 committing subrepository s
41
40
42 Revert can't (yet) revert subrepos:
41 Revert can't (yet) revert subrepos:
43
42
@@ -105,7 +104,6 b' bump sub rev (and check it is ignored by'
105 $ echo b > s/a
104 $ echo b > s/a
106 $ hg -R s ci -ms1
105 $ hg -R s ci -ms1
107 $ hg --config ui.commitsubrepos=no ci -m3
106 $ hg --config ui.commitsubrepos=no ci -m3
108 committing subrepository s
109
107
110 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
108 leave sub dirty (and check ui.commitsubrepos=no aborts the commit)
111
109
@@ -455,7 +453,6 b" shouldn't need merging"
455 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
453 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
456 $ hg ci -Am1
454 $ hg ci -Am1
457 adding .hgsub
455 adding .hgsub
458 committing subrepository s
459 $ hg branch br
456 $ hg branch br
460 marked working directory as branch br
457 marked working directory as branch br
461 (branches are permanent and global, did you want a bookmark?)
458 (branches are permanent and global, did you want a bookmark?)
@@ -464,7 +461,6 b" shouldn't need merging"
464 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
461 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
465 $ hg ci -Am1
462 $ hg ci -Am1
466 adding b
463 adding b
467 committing subrepository s
468 $ hg up default
464 $ hg up default
469 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
465 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
470 $ echo c > c
466 $ echo c > c
@@ -483,7 +479,6 b" shouldn't need merging"
483 $ echo d > d
479 $ echo d > d
484 $ hg ci -Am1
480 $ hg ci -Am1
485 adding d
481 adding d
486 committing subrepository s
487 $ hg up 3
482 $ hg up 3
488 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
483 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
489 $ hg -R s up 5
484 $ hg -R s up 5
@@ -491,7 +486,6 b" shouldn't need merging"
491 $ echo e > e
486 $ echo e > e
492 $ hg ci -Am1
487 $ hg ci -Am1
493 adding e
488 adding e
494 committing subrepository s
495
489
496 $ hg up 5
490 $ hg up 5
497 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
491 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -519,8 +513,6 b' test subrepo delete from .hgsubstate'
519 $ hg -R testdelete add
513 $ hg -R testdelete add
520 adding testdelete/.hgsub (glob)
514 adding testdelete/.hgsub (glob)
521 $ hg -R testdelete ci -m "nested 1 & 2 added"
515 $ hg -R testdelete ci -m "nested 1 & 2 added"
522 committing subrepository nested
523 committing subrepository nested2
524 $ echo nested = nested > testdelete/.hgsub
516 $ echo nested = nested > testdelete/.hgsub
525 $ hg -R testdelete ci -m "nested 2 deleted"
517 $ hg -R testdelete ci -m "nested 2 deleted"
526 $ cat testdelete/.hgsubstate
518 $ cat testdelete/.hgsubstate
@@ -550,8 +542,6 b' test repository cloning'
550 $ hg -R main add
542 $ hg -R main add
551 adding main/.hgsub (glob)
543 adding main/.hgsub (glob)
552 $ hg -R main ci -m "add subrepos"
544 $ hg -R main ci -m "add subrepos"
553 committing subrepository nested_absolute
554 committing subrepository nested_relative
555 $ cd ..
545 $ cd ..
556 $ hg clone mercurial/main mercurial2/main
546 $ hg clone mercurial/main mercurial2/main
557 updating to branch default
547 updating to branch default
@@ -574,7 +564,6 b' Issue1977: multirepo push should fail if'
574 $ echo s = s > repo/.hgsub
564 $ echo s = s > repo/.hgsub
575 $ hg -R repo ci -Am1
565 $ hg -R repo ci -Am1
576 adding .hgsub
566 adding .hgsub
577 committing subrepository s
578 $ hg clone repo repo2
567 $ hg clone repo repo2
579 updating to branch default
568 updating to branch default
580 cloning subrepo s from $TESTTMP/sub/repo/s (glob)
569 cloning subrepo s from $TESTTMP/sub/repo/s (glob)
@@ -590,7 +579,6 b' Issue1977: multirepo push should fail if'
590 $ hg -R repo2/s ci -m3
579 $ hg -R repo2/s ci -m3
591 created new head
580 created new head
592 $ hg -R repo2 ci -m3
581 $ hg -R repo2 ci -m3
593 committing subrepository s
594 $ hg -q -R repo2 push
582 $ hg -q -R repo2 push
595 abort: push creates new remote head 9d66565e64e1!
583 abort: push creates new remote head 9d66565e64e1!
596 (did you forget to merge? use push -f to force)
584 (did you forget to merge? use push -f to force)
@@ -701,7 +689,6 b' subrepository:'
701 $ echo subrepo-2 = subrepo-2 >> .hgsub
689 $ echo subrepo-2 = subrepo-2 >> .hgsub
702 $ hg add .hgsub
690 $ hg add .hgsub
703 $ hg ci -m 'Added subrepos'
691 $ hg ci -m 'Added subrepos'
704 committing subrepository subrepo-1
705 committing subrepository subrepo-2
692 committing subrepository subrepo-2
706 $ hg st subrepo-2/file
693 $ hg st subrepo-2/file
707
694
@@ -859,17 +846,16 b" Test that removing .hgsubstate doesn't b"
859
846
860 $ hg rm -f .hgsubstate
847 $ hg rm -f .hgsubstate
861 $ hg ci -mrm
848 $ hg ci -mrm
862 committing subrepository s
849 nothing changed
863 committing subrepository t
850 [1]
864 created new head
865 $ hg log -vr tip
851 $ hg log -vr tip
866 changeset: 14:3941e0aa5236
852 changeset: 13:925c17564ef8
867 tag: tip
853 tag: tip
868 parent: 11:365661e5936a
869 user: test
854 user: test
870 date: Thu Jan 01 00:00:00 1970 +0000
855 date: Thu Jan 01 00:00:00 1970 +0000
856 files: .hgsubstate
871 description:
857 description:
872 rm
858 13
873
859
874
860
875
861
@@ -877,9 +863,11 b' Test that removing .hgsub removes .hgsub'
877
863
878 $ hg rm .hgsub
864 $ hg rm .hgsub
879 $ hg ci -mrm2
865 $ hg ci -mrm2
866 created new head
880 $ hg log -vr tip
867 $ hg log -vr tip
881 changeset: 15:8b31de9d13d1
868 changeset: 14:2400bccd50af
882 tag: tip
869 tag: tip
870 parent: 11:365661e5936a
883 user: test
871 user: test
884 date: Thu Jan 01 00:00:00 1970 +0000
872 date: Thu Jan 01 00:00:00 1970 +0000
885 files: .hgsub .hgsubstate
873 files: .hgsub .hgsubstate
@@ -890,13 +878,13 b' Test that removing .hgsub removes .hgsub'
890 Test issue3153: diff -S with deleted subrepos
878 Test issue3153: diff -S with deleted subrepos
891
879
892 $ hg diff --nodates -S -c .
880 $ hg diff --nodates -S -c .
893 diff -r 3941e0aa5236 -r 8b31de9d13d1 .hgsub
881 diff -r 365661e5936a -r 2400bccd50af .hgsub
894 --- a/.hgsub
882 --- a/.hgsub
895 +++ /dev/null
883 +++ /dev/null
896 @@ -1,2 +0,0 @@
884 @@ -1,2 +0,0 @@
897 -s = s
885 -s = s
898 -t = t
886 -t = t
899 diff -r 3941e0aa5236 -r 8b31de9d13d1 .hgsubstate
887 diff -r 365661e5936a -r 2400bccd50af .hgsubstate
900 --- a/.hgsubstate
888 --- a/.hgsubstate
901 +++ /dev/null
889 +++ /dev/null
902 @@ -1,2 +0,0 @@
890 @@ -1,2 +0,0 @@
@@ -911,7 +899,6 b' Test behavior of add for explicit path i'
911 $ hg add .hgsub
899 $ hg add .hgsub
912 $ hg init s
900 $ hg init s
913 $ hg ci -m0
901 $ hg ci -m0
914 committing subrepository s
915 Adding with an explicit path in a subrepo adds the file
902 Adding with an explicit path in a subrepo adds the file
916 $ echo c1 > f1
903 $ echo c1 > f1
917 $ echo c2 > s/f2
904 $ echo c2 > s/f2
@@ -925,7 +912,6 b' Adding with an explicit path in a subrep'
925 $ hg ci -R s -m0
912 $ hg ci -R s -m0
926 $ hg ci -Am1
913 $ hg ci -Am1
927 adding f1
914 adding f1
928 committing subrepository s
929 Adding with an explicit path in a subrepo with -S has the same behavior
915 Adding with an explicit path in a subrepo with -S has the same behavior
930 $ echo c3 > f3
916 $ echo c3 > f3
931 $ echo c4 > s/f4
917 $ echo c4 > s/f4
@@ -939,7 +925,6 b' Adding with an explicit path in a subrep'
939 $ hg ci -R s -m1
925 $ hg ci -R s -m1
940 $ hg ci -Ama2
926 $ hg ci -Ama2
941 adding f3
927 adding f3
942 committing subrepository s
943 Adding without a path or pattern silently ignores subrepos
928 Adding without a path or pattern silently ignores subrepos
944 $ echo c5 > f5
929 $ echo c5 > f5
945 $ echo c6 > s/f6
930 $ echo c6 > s/f6
@@ -958,7 +943,6 b' Adding without a path or pattern silentl'
958 adding f6
943 adding f6
959 adding f7
944 adding f7
960 $ hg ci -m3
945 $ hg ci -m3
961 committing subrepository s
962 Adding without a path or pattern with -S also adds files in subrepos
946 Adding without a path or pattern with -S also adds files in subrepos
963 $ echo c8 > f8
947 $ echo c8 > f8
964 $ echo c9 > s/f9
948 $ echo c9 > s/f9
@@ -977,7 +961,6 b' Adding without a path or pattern with -S'
977 A s/f9
961 A s/f9
978 $ hg ci -R s -m3
962 $ hg ci -R s -m3
979 $ hg ci -m4
963 $ hg ci -m4
980 committing subrepository s
981 Adding with a pattern silently ignores subrepos
964 Adding with a pattern silently ignores subrepos
982 $ echo c11 > fm11
965 $ echo c11 > fm11
983 $ echo c12 > fn12
966 $ echo c12 > fn12
@@ -1000,7 +983,6 b' Adding with a pattern silently ignores s'
1000 adding fn14
983 adding fn14
1001 $ hg ci -Am5
984 $ hg ci -Am5
1002 adding fn12
985 adding fn12
1003 committing subrepository s
1004 Adding with a pattern with -S also adds matches in subrepos
986 Adding with a pattern with -S also adds matches in subrepos
1005 $ echo c15 > fm15
987 $ echo c15 > fm15
1006 $ echo c16 > fn16
988 $ echo c16 > fn16
@@ -1023,7 +1005,6 b' Adding with a pattern with -S also adds '
1023 adding fn18
1005 adding fn18
1024 $ hg ci -Am6
1006 $ hg ci -Am6
1025 adding fn16
1007 adding fn16
1026 committing subrepository s
1027
1008
1028 Test behavior of forget for explicit path in subrepo:
1009 Test behavior of forget for explicit path in subrepo:
1029 Forgetting an explicit path in a subrepo untracks the file
1010 Forgetting an explicit path in a subrepo untracks the file
General Comments 0
You need to be logged in to leave comments. Login now