Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: sitescripts/hg/bin/irchook.py

Issue 29430555: Issue 5212 - IRC hook should report bookmarked branches (Closed) Base URL: https://hg.adblockplus.org/sitescripts/
Patch Set: Created May 5, 2017, 8:44 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import os 1 import os
2 import subprocess 2 import subprocess
3 import pipes 3 import pipes
4 4
5 from sitescripts.utils import get_config 5 from sitescripts.utils import get_config
6 6
7 7
8 def hook(ui, repo, node=None, **kwargs): 8 def hook(ui, repo, node=None, **kwargs):
9 ctx = repo[node] 9 ctx = repo[node]
10 branches = ctx.bookmarks()
Vasily Kuznetsov 2017/05/05 09:23:08 I wonder if we could give a better name to this va
Wladimir Palant 2017/05/05 09:50:24 Let's go with commmit_identifiers.
Vasily Kuznetsov 2017/05/05 09:57:33 I like this.
11 if len(branches) == 0 or ctx.branch() != 'default':
Vasily Kuznetsov 2017/05/05 09:23:08 Since branches is a list we could just write `not
Wladimir Palant 2017/05/05 09:50:24 Done.
12 branches.append(ctx.branch())
10 remote = [get_config().get('irchook', 'remote_command'), 13 remote = [get_config().get('irchook', 'remote_command'),
11 os.path.basename(repo.root), str(ctx.branch()), str(ctx.user()), 14 os.path.basename(repo.root), ','.join(branches), str(ctx.user()),
12 str(ctx), str(ctx.description())] 15 str(ctx), str(ctx.description())]
13 remote = ' '.join(map(lambda s: pipes.quote(s), remote)) 16 remote = ' '.join(map(lambda s: pipes.quote(s), remote))
14 17
15 command = ['ssh', get_config().get('irchook', 'remote_host'), remote] 18 command = ['ssh', get_config().get('irchook', 'remote_host'), remote]
16 subprocess.call(command) 19 subprocess.call(command)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld