equal
deleted
inserted
replaced
39 opargs = {} |
39 opargs = {} |
40 newargs['opargs'] = opargs.copy() |
40 newargs['opargs'] = opargs.copy() |
41 newargs['opargs']['publish'] = True |
41 newargs['opargs']['publish'] = True |
42 return orig(repo, remote, *args, **newargs) |
42 return orig(repo, remote, *args, **newargs) |
43 |
43 |
44 def extendpushoperation(orig, *args, **kwargs): |
44 def extendpushoperation(orig, self, *args, **kwargs): |
45 publish = kwargs.pop('publish', False) |
45 publish = kwargs.pop('publish', False) |
46 op = orig(*args, **kwargs) |
46 orig(self, *args, **kwargs) |
47 op.publish = publish |
47 self.publish = publish |
48 return op |
|
49 |
48 |
50 def wrapphasediscovery(orig, pushop): |
49 def wrapphasediscovery(orig, pushop): |
51 orig(pushop) |
50 orig(pushop) |
52 if pushop.publish: |
51 if pushop.publish: |
53 if not util.safehasattr(pushop, 'remotephases'): |
52 if not util.safehasattr(pushop, 'remotephases'): |
62 |
61 |
63 def installpushflag(ui): |
62 def installpushflag(ui): |
64 entry = extensions.wrapcommand(commands.table, 'push', wrappush) |
63 entry = extensions.wrapcommand(commands.table, 'push', wrappush) |
65 entry[1].append(('', 'publish', False, |
64 entry[1].append(('', 'publish', False, |
66 _('push the changeset as public'))) |
65 _('push the changeset as public'))) |
67 extensions.wrapfunction(exchange, 'pushoperation', extendpushoperation) |
66 extensions.wrapfunction(exchange.pushoperation, '__init__', |
|
67 extendpushoperation) |
68 extensions.wrapfunction(exchange, '_pushdiscoveryphase', wrapphasediscovery) |
68 extensions.wrapfunction(exchange, '_pushdiscoveryphase', wrapphasediscovery) |
69 exchange.pushdiscoverymapping['phase'] = exchange._pushdiscoveryphase |
69 exchange.pushdiscoverymapping['phase'] = exchange._pushdiscoveryphase |