##// END OF EJS Templates
graphlog: use '%' for other context in merge conflict...
Martin von Zweigbergk -
r44819:14d0e895 default
parent child Browse files
Show More
@@ -71,6 +71,8 b' def getprettygraphnode(orig, *args, **kw'
71 71 return b'\xE2\x97\x8B' # U+25CB ○
72 72 if node == b'@':
73 73 return b'\xE2\x97\x8D' # U+25CD ◍
74 if node == b'%':
75 return b'\xE2\x97\x8D' # U+25CE ◎
74 76 if node == b'*':
75 77 return b'\xE2\x88\x97' # U+2217 ∗
76 78 if node == b'x':
@@ -936,5 +936,5 b' def getwebsubs(repo):'
936 936
937 937 def getgraphnode(repo, ctx):
938 938 return templatekw.getgraphnodecurrent(
939 repo, ctx
939 repo, ctx, {}
940 940 ) + templatekw.getgraphnodesymbol(ctx)
@@ -1004,7 +1004,7 b' def _graphnodeformatter(ui, displayer):'
1004 1004 ui, spec, defaults=templatekw.keywords, resources=tres
1005 1005 )
1006 1006
1007 def formatnode(repo, ctx):
1007 def formatnode(repo, ctx, cache):
1008 1008 props = {b'ctx': ctx, b'repo': repo}
1009 1009 return templ.renderdefault(props)
1010 1010
@@ -1038,8 +1038,9 b' def displaygraph(ui, repo, dag, displaye'
1038 1038 # experimental config: experimental.graphshorten
1039 1039 state.graphshorten = ui.configbool(b'experimental', b'graphshorten')
1040 1040
1041 formatnode_cache = {}
1041 1042 for rev, type, ctx, parents in dag:
1042 char = formatnode(repo, ctx)
1043 char = formatnode(repo, ctx, formatnode_cache)
1043 1044 copies = getcopies(ctx) if getcopies else None
1044 1045 edges = edgefn(type, char, state, rev, parents)
1045 1046 firstedge = next(edges)
@@ -396,26 +396,38 b' def showfiles(context, mapping):'
396 396 return templateutil.compatfileslist(context, mapping, b'file', ctx.files())
397 397
398 398
399 @templatekeyword(b'graphnode', requires={b'repo', b'ctx'})
399 @templatekeyword(b'graphnode', requires={b'repo', b'ctx', b'cache'})
400 400 def showgraphnode(context, mapping):
401 401 """String. The character representing the changeset node in an ASCII
402 402 revision graph."""
403 403 repo = context.resource(mapping, b'repo')
404 404 ctx = context.resource(mapping, b'ctx')
405 return getgraphnode(repo, ctx)
405 cache = context.resource(mapping, b'cache')
406 return getgraphnode(repo, ctx, cache)
406 407
407 408
408 def getgraphnode(repo, ctx):
409 return getgraphnodecurrent(repo, ctx) or getgraphnodesymbol(ctx)
409 def getgraphnode(repo, ctx, cache):
410 return getgraphnodecurrent(repo, ctx, cache) or getgraphnodesymbol(ctx)
410 411
411 412
412 def getgraphnodecurrent(repo, ctx):
413 def getgraphnodecurrent(repo, ctx, cache):
413 414 wpnodes = repo.dirstate.parents()
414 415 if wpnodes[1] == nullid:
415 416 wpnodes = wpnodes[:1]
416 417 if ctx.node() in wpnodes:
417 418 return b'@'
418 419 else:
420 merge_nodes = cache.get(b'merge_nodes', ())
421 if not merge_nodes:
422 from . import merge
423
424 mergestate = merge.mergestate.read(repo)
425 if mergestate.active():
426 merge_nodes = (mergestate.local, mergestate.other)
427 cache[b'merge_nodes'] = merge_nodes
428
429 if ctx.node() in merge_nodes:
430 return b'%'
419 431 return b''
420 432
421 433
@@ -3,7 +3,12 b''
3 3 * `hg purge`/`hg clean` can now delete ignored files instead of
4 4 untracked files, with the new -i flag.
5 5
6 * New `conflictlocal()` and `conflictother()` revsets returns the
6 * `hg log` now defaults to using an '%' symbol for commits involved
7 in unresolved merge conflicts. That includes unresolved conflicts
8 caused by e.g. `hg update --merge` and `hg graft`. '@' still takes
9 precedence, so what used to be marked '@' still is.
10
11 * New `conflictlocal()` and `conflictother()` revsets return the
7 12 commits that are being merged, when there are conflicts. Also works
8 13 for conflicts caused by e.g. `hg graft`.
9 14
@@ -103,7 +103,7 b' commit option'
103 103 | date: Thu Jan 01 00:00:02 1970 +0000
104 104 | summary: grapes
105 105 |
106 o changeset: 1:22cb4f70d813
106 % changeset: 1:22cb4f70d813
107 107 | user: test
108 108 | date: Thu Jan 01 00:00:01 1970 +0000
109 109 | summary: chair
@@ -748,7 +748,7 b' Test usage of `hg resolve` in case of co'
748 748 | date: Thu Jan 01 00:00:00 1970 +0000
749 749 | summary: capital three
750 750 |
751 o changeset: 0:a30dd8addae3
751 % changeset: 0:a30dd8addae3
752 752 user: test
753 753 date: Thu Jan 01 00:00:00 1970 +0000
754 754 summary: initial
@@ -431,7 +431,7 b' when some of the changesets became publi'
431 431 $ hg log -GT "{rev}:{node|short} {desc}"
432 432 @ 6:6ec71c037d94 added x
433 433 |
434 | o 5:36b793615f78 added foo to c
434 | % 5:36b793615f78 added foo to c
435 435 | |
436 436 | | o 4:863a25e1a9ea added x
437 437 | |/
@@ -622,7 +622,7 b' Resolve conflict:'
622 622 $ hg log -GT "{rev}:{node|short} {desc}\n"
623 623 @ 4:2aa9ad1006ff B in file a
624 624 |
625 | o 3:09e253b87e17 A in file a
625 | % 3:09e253b87e17 A in file a
626 626 | |
627 627 | o 2:d36c0562f908 c
628 628 | |
@@ -669,7 +669,7 b' Resolve conflict:'
669 669 $ hg log -GT "{rev}:{node|short} {desc}\n"
670 670 @ 4:2aa9ad1006ff B in file a
671 671 |
672 | o 3:09e253b87e17 A in file a
672 | % 3:09e253b87e17 A in file a
673 673 | |
674 674 | o 2:d36c0562f908 c
675 675 | |
@@ -712,7 +712,7 b' When there is conflict:'
712 712 $ hg log -GT "{rev}:{node|short} {desc}\n"
713 713 @ 4:2aa9ad1006ff B in file a
714 714 |
715 | o 3:09e253b87e17 A in file a
715 | % 3:09e253b87e17 A in file a
716 716 | |
717 717 | o 2:d36c0562f908 c
718 718 | |
@@ -762,7 +762,7 b' Test aborted editor on final message'
762 762 abort: edit failed: false exited with status 1
763 763 [255]
764 764 $ hg tglog
765 o 3: 63668d570d21 'C'
765 % 3: 63668d570d21 'C'
766 766 |
767 767 | @ 2: 82b8abf9c185 'D'
768 768 | |
@@ -598,7 +598,7 b' Verify strip protects against stripping '
598 598 | date: Thu Jan 01 00:00:00 1970 +0000
599 599 | summary: b
600 600 |
601 o changeset: 0:9ab35a2d17cb
601 % changeset: 0:9ab35a2d17cb
602 602 user: test
603 603 date: Thu Jan 01 00:00:00 1970 +0000
604 604 summary: a
@@ -254,7 +254,7 b' Cases are run as shown in that table, ro'
254 254 |
255 255 @ 4:d047485b3896 0:60829823a42a b1
256 256 |
257 | o 3:6efa171f091b 1:0786582aa4b1
257 | % 3:6efa171f091b 1:0786582aa4b1
258 258 | |
259 259 | | o 2:bd10386d478c
260 260 | |/
General Comments 0
You need to be logged in to leave comments. Login now