##// 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 return b'\xE2\x97\x8B' # U+25CB ○
71 return b'\xE2\x97\x8B' # U+25CB ○
72 if node == b'@':
72 if node == b'@':
73 return b'\xE2\x97\x8D' # U+25CD ◍
73 return b'\xE2\x97\x8D' # U+25CD ◍
74 if node == b'%':
75 return b'\xE2\x97\x8D' # U+25CE ◎
74 if node == b'*':
76 if node == b'*':
75 return b'\xE2\x88\x97' # U+2217 ∗
77 return b'\xE2\x88\x97' # U+2217 ∗
76 if node == b'x':
78 if node == b'x':
@@ -936,5 +936,5 b' def getwebsubs(repo):'
936
936
937 def getgraphnode(repo, ctx):
937 def getgraphnode(repo, ctx):
938 return templatekw.getgraphnodecurrent(
938 return templatekw.getgraphnodecurrent(
939 repo, ctx
939 repo, ctx, {}
940 ) + templatekw.getgraphnodesymbol(ctx)
940 ) + templatekw.getgraphnodesymbol(ctx)
@@ -1004,7 +1004,7 b' def _graphnodeformatter(ui, displayer):'
1004 ui, spec, defaults=templatekw.keywords, resources=tres
1004 ui, spec, defaults=templatekw.keywords, resources=tres
1005 )
1005 )
1006
1006
1007 def formatnode(repo, ctx):
1007 def formatnode(repo, ctx, cache):
1008 props = {b'ctx': ctx, b'repo': repo}
1008 props = {b'ctx': ctx, b'repo': repo}
1009 return templ.renderdefault(props)
1009 return templ.renderdefault(props)
1010
1010
@@ -1038,8 +1038,9 b' def displaygraph(ui, repo, dag, displaye'
1038 # experimental config: experimental.graphshorten
1038 # experimental config: experimental.graphshorten
1039 state.graphshorten = ui.configbool(b'experimental', b'graphshorten')
1039 state.graphshorten = ui.configbool(b'experimental', b'graphshorten')
1040
1040
1041 formatnode_cache = {}
1041 for rev, type, ctx, parents in dag:
1042 for rev, type, ctx, parents in dag:
1042 char = formatnode(repo, ctx)
1043 char = formatnode(repo, ctx, formatnode_cache)
1043 copies = getcopies(ctx) if getcopies else None
1044 copies = getcopies(ctx) if getcopies else None
1044 edges = edgefn(type, char, state, rev, parents)
1045 edges = edgefn(type, char, state, rev, parents)
1045 firstedge = next(edges)
1046 firstedge = next(edges)
@@ -396,26 +396,38 b' def showfiles(context, mapping):'
396 return templateutil.compatfileslist(context, mapping, b'file', ctx.files())
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 def showgraphnode(context, mapping):
400 def showgraphnode(context, mapping):
401 """String. The character representing the changeset node in an ASCII
401 """String. The character representing the changeset node in an ASCII
402 revision graph."""
402 revision graph."""
403 repo = context.resource(mapping, b'repo')
403 repo = context.resource(mapping, b'repo')
404 ctx = context.resource(mapping, b'ctx')
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 def getgraphnode(repo, ctx, cache):
409 return getgraphnodecurrent(repo, ctx) or getgraphnodesymbol(ctx)
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 wpnodes = repo.dirstate.parents()
414 wpnodes = repo.dirstate.parents()
414 if wpnodes[1] == nullid:
415 if wpnodes[1] == nullid:
415 wpnodes = wpnodes[:1]
416 wpnodes = wpnodes[:1]
416 if ctx.node() in wpnodes:
417 if ctx.node() in wpnodes:
417 return b'@'
418 return b'@'
418 else:
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 return b''
431 return b''
420
432
421
433
@@ -3,7 +3,12 b''
3 * `hg purge`/`hg clean` can now delete ignored files instead of
3 * `hg purge`/`hg clean` can now delete ignored files instead of
4 untracked files, with the new -i flag.
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 commits that are being merged, when there are conflicts. Also works
12 commits that are being merged, when there are conflicts. Also works
8 for conflicts caused by e.g. `hg graft`.
13 for conflicts caused by e.g. `hg graft`.
9
14
@@ -103,7 +103,7 b' commit option'
103 | date: Thu Jan 01 00:00:02 1970 +0000
103 | date: Thu Jan 01 00:00:02 1970 +0000
104 | summary: grapes
104 | summary: grapes
105 |
105 |
106 o changeset: 1:22cb4f70d813
106 % changeset: 1:22cb4f70d813
107 | user: test
107 | user: test
108 | date: Thu Jan 01 00:00:01 1970 +0000
108 | date: Thu Jan 01 00:00:01 1970 +0000
109 | summary: chair
109 | summary: chair
@@ -748,7 +748,7 b' Test usage of `hg resolve` in case of co'
748 | date: Thu Jan 01 00:00:00 1970 +0000
748 | date: Thu Jan 01 00:00:00 1970 +0000
749 | summary: capital three
749 | summary: capital three
750 |
750 |
751 o changeset: 0:a30dd8addae3
751 % changeset: 0:a30dd8addae3
752 user: test
752 user: test
753 date: Thu Jan 01 00:00:00 1970 +0000
753 date: Thu Jan 01 00:00:00 1970 +0000
754 summary: initial
754 summary: initial
@@ -431,7 +431,7 b' when some of the changesets became publi'
431 $ hg log -GT "{rev}:{node|short} {desc}"
431 $ hg log -GT "{rev}:{node|short} {desc}"
432 @ 6:6ec71c037d94 added x
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 | | o 4:863a25e1a9ea added x
436 | | o 4:863a25e1a9ea added x
437 | |/
437 | |/
@@ -622,7 +622,7 b' Resolve conflict:'
622 $ hg log -GT "{rev}:{node|short} {desc}\n"
622 $ hg log -GT "{rev}:{node|short} {desc}\n"
623 @ 4:2aa9ad1006ff B in file a
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 | o 2:d36c0562f908 c
627 | o 2:d36c0562f908 c
628 | |
628 | |
@@ -669,7 +669,7 b' Resolve conflict:'
669 $ hg log -GT "{rev}:{node|short} {desc}\n"
669 $ hg log -GT "{rev}:{node|short} {desc}\n"
670 @ 4:2aa9ad1006ff B in file a
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 | o 2:d36c0562f908 c
674 | o 2:d36c0562f908 c
675 | |
675 | |
@@ -712,7 +712,7 b' When there is conflict:'
712 $ hg log -GT "{rev}:{node|short} {desc}\n"
712 $ hg log -GT "{rev}:{node|short} {desc}\n"
713 @ 4:2aa9ad1006ff B in file a
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 | o 2:d36c0562f908 c
717 | o 2:d36c0562f908 c
718 | |
718 | |
@@ -762,7 +762,7 b' Test aborted editor on final message'
762 abort: edit failed: false exited with status 1
762 abort: edit failed: false exited with status 1
763 [255]
763 [255]
764 $ hg tglog
764 $ hg tglog
765 o 3: 63668d570d21 'C'
765 % 3: 63668d570d21 'C'
766 |
766 |
767 | @ 2: 82b8abf9c185 'D'
767 | @ 2: 82b8abf9c185 'D'
768 | |
768 | |
@@ -598,7 +598,7 b' Verify strip protects against stripping '
598 | date: Thu Jan 01 00:00:00 1970 +0000
598 | date: Thu Jan 01 00:00:00 1970 +0000
599 | summary: b
599 | summary: b
600 |
600 |
601 o changeset: 0:9ab35a2d17cb
601 % changeset: 0:9ab35a2d17cb
602 user: test
602 user: test
603 date: Thu Jan 01 00:00:00 1970 +0000
603 date: Thu Jan 01 00:00:00 1970 +0000
604 summary: a
604 summary: a
@@ -254,7 +254,7 b' Cases are run as shown in that table, ro'
254 |
254 |
255 @ 4:d047485b3896 0:60829823a42a b1
255 @ 4:d047485b3896 0:60829823a42a b1
256 |
256 |
257 | o 3:6efa171f091b 1:0786582aa4b1
257 | % 3:6efa171f091b 1:0786582aa4b1
258 | |
258 | |
259 | | o 2:bd10386d478c
259 | | o 2:bd10386d478c
260 | |/
260 | |/
General Comments 0
You need to be logged in to leave comments. Login now