##// END OF EJS Templates
drawdag: include files from both parents in merge commits...
Martin von Zweigbergk -
r33558:0103e718 default
parent child Browse files
Show More
@@ -235,22 +235,21 b' class simplefilectx(object):'
235 return ''
235 return ''
236
236
237 class simplecommitctx(context.committablectx):
237 class simplecommitctx(context.committablectx):
238 def __init__(self, repo, name, parentctxs, added=None):
238 def __init__(self, repo, name, parentctxs, added):
239 opts = {
239 opts = {
240 'changes': scmutil.status([], added or [], [], [], [], [], []),
240 'changes': scmutil.status([], list(added), [], [], [], [], []),
241 'date': '0 0',
241 'date': '0 0',
242 'extra': {'branch': 'default'},
242 'extra': {'branch': 'default'},
243 }
243 }
244 super(simplecommitctx, self).__init__(self, name, **opts)
244 super(simplecommitctx, self).__init__(self, name, **opts)
245 self._repo = repo
245 self._repo = repo
246 self._name = name
246 self._added = added
247 self._parents = parentctxs
247 self._parents = parentctxs
248 self._parents.sort(key=lambda c: c.node())
249 while len(self._parents) < 2:
248 while len(self._parents) < 2:
250 self._parents.append(repo[node.nullid])
249 self._parents.append(repo[node.nullid])
251
250
252 def filectx(self, key):
251 def filectx(self, key):
253 return simplefilectx(key, self._name)
252 return simplefilectx(key, self._added[key])
254
253
255 def commit(self):
254 def commit(self):
256 return self._repo.commitctx(self)
255 return self._repo.commitctx(self)
@@ -317,7 +316,17 b' def debugdrawdag(ui, repo, **opts):'
317 if name in committed:
316 if name in committed:
318 continue
317 continue
319 pctxs = [repo[committed[n]] for n in parents]
318 pctxs = [repo[committed[n]] for n in parents]
320 ctx = simplecommitctx(repo, name, pctxs, [name])
319 pctxs.sort(key=lambda c: c.node())
320 added = {}
321 if len(parents) > 1:
322 # If it's a merge, take the files and contents from the parents
323 for f in pctxs[1].manifest():
324 if f not in pctxs[0].manifest():
325 added[f] = pctxs[1][f].data()
326 else:
327 # If it's not a merge, add a single file
328 added[name] = name
329 ctx = simplecommitctx(repo, name, pctxs, added)
321 n = ctx.commit()
330 n = ctx.commit()
322 committed[name] = n
331 committed[name] = n
323 tagsmod.tag(repo, name, n, message=None, user=None, date=None,
332 tagsmod.tag(repo, name, n, message=None, user=None, date=None,
@@ -213,7 +213,7 b' Set up repo with non-linear history'
213 $ hg log -G -T '{node|short} {desc} {phase}\n'
213 $ hg log -G -T '{node|short} {desc} {phase}\n'
214 o 03ca77807e91 E draft
214 o 03ca77807e91 E draft
215 |
215 |
216 | o 215e7b0814e1 D secret
216 | o 4e4f9194f9f1 D secret
217 |/|
217 |/|
218 o | dc0947a82db8 C public
218 o | dc0947a82db8 C public
219 | |
219 | |
@@ -231,7 +231,7 b' Restore bundle of entire repo'
231 426bada5c67598ca65036d57d9e4b64b0c1ce7a0
231 426bada5c67598ca65036d57d9e4b64b0c1ce7a0
232 112478962961147124edd43549aedd1a335e44bf
232 112478962961147124edd43549aedd1a335e44bf
233 dc0947a82db884575bb76ea10ac97b08536bfa03
233 dc0947a82db884575bb76ea10ac97b08536bfa03
234 215e7b0814e1cac8e2614e7284f2a5dc266b4323
234 4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4
235 03ca77807e919db8807c3749086dc36fb478cac0
235 03ca77807e919db8807c3749086dc36fb478cac0
236 phase-heads -- 'sortdict()'
236 phase-heads -- 'sortdict()'
237 dc0947a82db884575bb76ea10ac97b08536bfa03 public
237 dc0947a82db884575bb76ea10ac97b08536bfa03 public
@@ -242,7 +242,7 b' Restore bundle of entire repo'
242 $ hg log -G -T '{node|short} {desc} {phase}\n'
242 $ hg log -G -T '{node|short} {desc} {phase}\n'
243 o 03ca77807e91 E draft
243 o 03ca77807e91 E draft
244 |
244 |
245 | o 215e7b0814e1 D secret
245 | o 4e4f9194f9f1 D secret
246 |/|
246 |/|
247 o | dc0947a82db8 C public
247 o | dc0947a82db8 C public
248 | |
248 | |
@@ -257,7 +257,7 b' Restore bundle of entire repo'
257 Stream params: sortdict([('Compression', 'BZ')])
257 Stream params: sortdict([('Compression', 'BZ')])
258 changegroup -- "sortdict([('version', '02'), ('nbchanges', '2'), ('targetphase', '2')])"
258 changegroup -- "sortdict([('version', '02'), ('nbchanges', '2'), ('targetphase', '2')])"
259 112478962961147124edd43549aedd1a335e44bf
259 112478962961147124edd43549aedd1a335e44bf
260 215e7b0814e1cac8e2614e7284f2a5dc266b4323
260 4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4
261 phase-heads -- 'sortdict()'
261 phase-heads -- 'sortdict()'
262 $ rm bundle
262 $ rm bundle
263
263
@@ -268,7 +268,7 b' Restore bundle of entire repo'
268 changegroup -- "sortdict([('version', '02'), ('nbchanges', '3'), ('targetphase', '2')])"
268 changegroup -- "sortdict([('version', '02'), ('nbchanges', '3'), ('targetphase', '2')])"
269 112478962961147124edd43549aedd1a335e44bf
269 112478962961147124edd43549aedd1a335e44bf
270 dc0947a82db884575bb76ea10ac97b08536bfa03
270 dc0947a82db884575bb76ea10ac97b08536bfa03
271 215e7b0814e1cac8e2614e7284f2a5dc266b4323
271 4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4
272 phase-heads -- 'sortdict()'
272 phase-heads -- 'sortdict()'
273 dc0947a82db884575bb76ea10ac97b08536bfa03 public
273 dc0947a82db884575bb76ea10ac97b08536bfa03 public
274 $ rm bundle
274 $ rm bundle
@@ -278,7 +278,7 b' Restore bundle of entire repo'
278 $ hg debugbundle bundle
278 $ hg debugbundle bundle
279 Stream params: sortdict([('Compression', 'BZ')])
279 Stream params: sortdict([('Compression', 'BZ')])
280 changegroup -- "sortdict([('version', '02'), ('nbchanges', '2'), ('targetphase', '2')])"
280 changegroup -- "sortdict([('version', '02'), ('nbchanges', '2'), ('targetphase', '2')])"
281 215e7b0814e1cac8e2614e7284f2a5dc266b4323
281 4e4f9194f9f181c57f62e823e8bdfa46ab9e4ff4
282 03ca77807e919db8807c3749086dc36fb478cac0
282 03ca77807e919db8807c3749086dc36fb478cac0
283 phase-heads -- 'sortdict()'
283 phase-heads -- 'sortdict()'
284 03ca77807e919db8807c3749086dc36fb478cac0 draft
284 03ca77807e919db8807c3749086dc36fb478cac0 draft
@@ -117,6 +117,18 b' Test what said in drawdag.py docstring'
117 /
117 /
118 o a
118 o a
119
119
120 $ hg manifest -r a
121 a
122 $ hg manifest -r b
123 a
124 b
125 $ hg manifest -r bar
126 a
127 b
128 $ hg manifest -r foo
129 a
130 b
131 baz
120
132
121 Edges existed in repo are no-ops
133 Edges existed in repo are no-ops
122
134
@@ -65,7 +65,7 b' Multiple branching points caused by sele'
65 > EOS
65 > EOS
66 rebasing 2:c1e6b162678d "B" (B)
66 rebasing 2:c1e6b162678d "B" (B)
67 rebasing 3:d6003a550c2c "C" (C)
67 rebasing 3:d6003a550c2c "C" (C)
68 rebasing 6:5251e0cb7302 "E" (E tip)
68 rebasing 6:54c8f00cb91c "E" (E tip)
69 o 6: E
69 o 6: E
70 |\
70 |\
71 | o 5: C
71 | o 5: C
@@ -92,7 +92,7 b' Rebase should not extend the "--base" re'
92 > R
92 > R
93 > EOS
93 > EOS
94 rebasing 2:c1e6b162678d "B" (B)
94 rebasing 2:c1e6b162678d "B" (B)
95 rebasing 5:5251e0cb7302 "E" (E tip)
95 rebasing 5:54c8f00cb91c "E" (E tip)
96 o 5: E
96 o 5: E
97 |\
97 |\
98 | o 4: B
98 | o 4: B
@@ -118,7 +118,7 b' Rebase should not simplify the "--base" '
118 > EOS
118 > EOS
119 rebasing 2:c1e6b162678d "B" (B)
119 rebasing 2:c1e6b162678d "B" (B)
120 rebasing 3:d6003a550c2c "C" (C)
120 rebasing 3:d6003a550c2c "C" (C)
121 rebasing 5:5251e0cb7302 "E" (E tip)
121 rebasing 5:54c8f00cb91c "E" (E tip)
122 o 5: E
122 o 5: E
123 |\
123 |\
124 | o 4: C
124 | o 4: C
@@ -208,18 +208,18 b' Multiple branching points with multiple '
208 > A A A
208 > A A A
209 > EOS
209 > EOS
210 rebasing 2:dc0947a82db8 "C" (C)
210 rebasing 2:dc0947a82db8 "C" (C)
211 rebasing 8:215e7b0814e1 "D" (D)
211 rebasing 8:4e4f9194f9f1 "D" (D)
212 rebasing 9:03ca77807e91 "E" (E)
212 rebasing 9:03ca77807e91 "E" (E)
213 rebasing 10:afc707c82df0 "F" (F)
213 rebasing 10:afc707c82df0 "F" (F)
214 rebasing 13:018caa673317 "G" (G)
214 rebasing 13:690dfff91e9e "G" (G)
215 rebasing 14:4f710fbd68cb "H" (H)
215 rebasing 14:2893b886bb10 "H" (H)
216 rebasing 3:08ebfeb61bac "I" (I)
216 rebasing 3:08ebfeb61bac "I" (I)
217 rebasing 4:a0a5005cec67 "J" (J)
217 rebasing 4:a0a5005cec67 "J" (J)
218 rebasing 5:83780307a7e8 "K" (K)
218 rebasing 5:83780307a7e8 "K" (K)
219 rebasing 6:e131637a1cb6 "L" (L)
219 rebasing 6:e131637a1cb6 "L" (L)
220 rebasing 11:d6fe3d11d95d "M" (M)
220 rebasing 11:d1f6d0c3c7e4 "M" (M)
221 rebasing 12:fa1e02269063 "N" (N)
221 rebasing 12:7aaec6f81888 "N" (N)
222 rebasing 15:448b1a498430 "P" (P tip)
222 rebasing 15:325bc8f1760d "P" (P tip)
223 o 15: P
223 o 15: P
224 |\
224 |\
225 | o 14: N
225 | o 14: N
@@ -269,9 +269,9 b' Slightly more complex merge case (mentio'
269 rebasing 6:06ca5dfe3b5b "B2" (B2)
269 rebasing 6:06ca5dfe3b5b "B2" (B2)
270 rebasing 7:73508237b032 "C1" (C1)
270 rebasing 7:73508237b032 "C1" (C1)
271 rebasing 9:fdb955e2faed "A2" (A2)
271 rebasing 9:fdb955e2faed "A2" (A2)
272 rebasing 11:1b2f368c3cb5 "A3" (A3)
272 rebasing 11:4e449bd1a643 "A3" (A3)
273 rebasing 10:0a33b0519128 "B1" (B1)
273 rebasing 10:0a33b0519128 "B1" (B1)
274 rebasing 12:bd6a37b5b67a "B3" (B3 tip)
274 rebasing 12:209327807c3a "B3" (B3 tip)
275 o 12: B3
275 o 12: B3
276 |\
276 |\
277 | o 11: B1
277 | o 11: B1
@@ -334,7 +334,7 b' Multiple roots. One root is not an ances'
334 > \|\|
334 > \|\|
335 > A C
335 > A C
336 > EOF
336 > EOF
337 nothing to rebase from 86d01f49c0d9+b70f76719894 to 262e37e34f63
337 nothing to rebase from f675d5a1c6a4+b70f76719894 to 262e37e34f63
338 [1]
338 [1]
339
339
340 Multiple roots. One root is not an ancestor of dest. Select using a merge:
340 Multiple roots. One root is not an ancestor of dest. Select using a merge:
@@ -346,8 +346,8 b' Multiple roots. One root is not an ances'
346 > \|\|
346 > \|\|
347 > A C
347 > A C
348 > EOF
348 > EOF
349 rebasing 2:86d01f49c0d9 "B" (B)
349 rebasing 2:f675d5a1c6a4 "B" (B)
350 rebasing 5:539a0ff83ea9 "E" (E tip)
350 rebasing 5:f68696fe6af8 "E" (E tip)
351 o 5: E
351 o 5: E
352 |\
352 |\
353 | o 4: B
353 | o 4: B
@@ -367,8 +367,8 b' Multiple roots. Two children share two p'
367 > \|\|\
367 > \|\|\
368 > A C A
368 > A C A
369 > EOF
369 > EOF
370 rebasing 2:86d01f49c0d9 "B" (B)
370 rebasing 2:f675d5a1c6a4 "B" (B)
371 rebasing 3:b7df2ca01aa8 "D" (D)
371 rebasing 3:c2a779e13b56 "D" (D)
372 o 4: D
372 o 4: D
373 |\
373 |\
374 +---o 3: B
374 +---o 3: B
@@ -974,7 +974,7 b' Use delayedstrip to strip inside a trans'
974 > EOF
974 > EOF
975 $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/delayedstrip.py
975 $ hg log -r . -T '\n' --config extensions.t=$TESTTMP/delayedstrip.py
976 warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22
976 warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22
977 saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-81fa23b0-I.hg (glob)
977 saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg (glob)
978
978
979 $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)'
979 $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)'
980 @ 6:2f2d51af6205 J
980 @ 6:2f2d51af6205 J
@@ -1030,9 +1030,9 b' Test high-level scmutil.cleanupnodes API'
1030 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1030 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1031 o 8:1473d4b996d1 G2 b-F@divergent3 b-G
1031 o 8:1473d4b996d1 G2 b-F@divergent3 b-G
1032 |
1032 |
1033 | o 7:d94e89b773b6 F2 b-F
1033 | o 7:d11b3456a873 F2 b-F
1034 | |
1034 | |
1035 | o 5:7fe5bac4c918 H
1035 | o 5:5cb05ba470a7 H
1036 |/|
1036 |/|
1037 | o 3:7fb047a69f22 E b-F@divergent1
1037 | o 3:7fb047a69f22 E b-F@divergent1
1038 | |
1038 | |
@@ -1050,7 +1050,7 b' Test high-level scmutil.cleanupnodes API'
1050 b-B 0:426bada5c675
1050 b-B 0:426bada5c675
1051 b-C 0:426bada5c675
1051 b-C 0:426bada5c675
1052 b-D 6:7c78f703e465
1052 b-D 6:7c78f703e465
1053 b-F 7:d94e89b773b6
1053 b-F 7:d11b3456a873
1054 b-F@divergent1 3:7fb047a69f22
1054 b-F@divergent1 3:7fb047a69f22
1055 b-F@divergent3 8:1473d4b996d1
1055 b-F@divergent3 8:1473d4b996d1
1056 b-G 8:1473d4b996d1
1056 b-G 8:1473d4b996d1
@@ -1073,9 +1073,9 b' we have reusable code here'
1073 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1073 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1074 o 12:1473d4b996d1 G2 b-F@divergent3 b-G
1074 o 12:1473d4b996d1 G2 b-F@divergent3 b-G
1075 |
1075 |
1076 | o 11:d94e89b773b6 F2 b-F
1076 | o 11:d11b3456a873 F2 b-F
1077 | |
1077 | |
1078 | o 8:7fe5bac4c918 H
1078 | o 8:5cb05ba470a7 H
1079 |/|
1079 |/|
1080 | o 4:7fb047a69f22 E b-F@divergent1
1080 | o 4:7fb047a69f22 E b-F@divergent1
1081 | |
1081 | |
@@ -1091,7 +1091,7 b' we have reusable code here'
1091
1091
1092 $ hg debugobsolete
1092 $ hg debugobsolete
1093 1fc8102cda6204549f031015641606ccf5513ec3 1473d4b996d1d1b121de6b39fab6a04fbf9d873e 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1093 1fc8102cda6204549f031015641606ccf5513ec3 1473d4b996d1d1b121de6b39fab6a04fbf9d873e 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1094 64a8289d249234b9886244d379f15e6b650b28e3 d94e89b773b67e72642a931159ada8d1a9246998 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1094 64a8289d249234b9886244d379f15e6b650b28e3 d11b3456a873daec7c7bc53e5622e8df6d741bd2 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1095 f585351a92f85104bff7c284233c338b10eb1df7 7c78f703e465d73102cc8780667ce269c5208a40 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1095 f585351a92f85104bff7c284233c338b10eb1df7 7c78f703e465d73102cc8780667ce269c5208a40 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1096 48b9aae0607f43ff110d84e6883c151942add5ab 0 {0000000000000000000000000000000000000000} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1096 48b9aae0607f43ff110d84e6883c151942add5ab 0 {0000000000000000000000000000000000000000} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1097 112478962961147124edd43549aedd1a335e44bf 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
1097 112478962961147124edd43549aedd1a335e44bf 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'replace', 'user': 'test'}
General Comments 0
You need to be logged in to leave comments. Login now