Changeset 0fd0fcc15287…
Parent 6d7bb6f17b97…
by
Changes to 2 files · Browse files at 0fd0fcc15287 Showing diff from parent 6d7bb6f17b97 Diff from another changeset...
@@ -80,7 +80,11 @@ 'Specify the visual diff tool; must be extdiff command'),
('Visual Editor', 'tortoisehg.editor', [],
'Specify the visual editor used to view files, etc'),
- ('Log Batch Size', 'tortoisehg.graphlimit', [],
+ ('Author Coloring', 'tortoisehg.authorcolor', ['False', 'True'],
+ 'Color changesets by author name. If not enabled,'
+ ' the changes are colored green for merge, red for'
+ ' non-trivial parents, black for normal. Default: False'),
+ ('Log Batch Size', 'tortoisehg.graphlimit', ['500'],
'The number of revisions to read and display in the'
' changelog viewer in a single batch. Default: 500'))
self.tortoise_frame = self.add_page(notebook, 'TortoiseHG')
|
@@ -266,7 +266,8 @@ if not k.startswith('authorcolor.'): continue
pat = k[12:]
self.author_pats.append((re.compile(pat, re.I), v))
- if self.author_pats:
+ if self.author_pats or self.repo.ui.configbool('tortoisehg',
+ 'authorcolor'):
self.color_func = self.text_color_author
else:
self.color_func = self.text_color_orig
@@ -394,11 +395,18 @@ else:
return 'black'
+ colors = '''black blue deeppink mediumorchid blue burlywood4 goldenrod
+ slateblue red2 navy dimgrey'''.split()
+ color_cache = {}
+
def text_color_author(self, parents, rev, author):
for re, v in self.author_pats:
if (re.search(author)):
return v
- return 'black'
+ if author not in self.color_cache:
+ color = self.colors[len(self.color_cache.keys()) % len(self.colors)]
+ self.color_cache[author] = color
+ return self.color_cache[author]
def _on_selection_changed(self, treeview):
"""callback for when the treeview changes."""
|
Loading...