Left: | ||
Right: |
OLD | NEW |
---|---|
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) |
OLD | NEW |