equal
deleted
inserted
replaced
5 error, |
5 error, |
6 exchange, |
6 exchange, |
7 extensions, |
7 extensions, |
8 node, |
8 node, |
9 phases, |
9 phases, |
10 util, |
|
11 ) |
10 ) |
12 |
11 |
13 from mercurial.i18n import _ |
12 from mercurial.i18n import _ |
14 |
13 |
15 def enforcesinglehead(repo, tr): |
14 def enforcesinglehead(repo, tr): |
73 self.publish = publish |
72 self.publish = publish |
74 |
73 |
75 def wrapphasediscovery(orig, pushop): |
74 def wrapphasediscovery(orig, pushop): |
76 orig(pushop) |
75 orig(pushop) |
77 if getattr(pushop, 'publish', False): |
76 if getattr(pushop, 'publish', False): |
78 if not util.safehasattr(pushop, 'remotephases'): |
|
79 msg = _('--publish flag only supported from Mercurial 4.4 and higher') |
|
80 raise error.Abort(msg) |
|
81 if not pushop.remotephases.publishing: |
77 if not pushop.remotephases.publishing: |
82 unfi = pushop.repo.unfiltered() |
78 unfi = pushop.repo.unfiltered() |
83 droots = pushop.remotephases.draftroots |
79 droots = pushop.remotephases.draftroots |
84 revset = '%ln and (not public() or %ln::)' |
80 revset = '%ln and (not public() or %ln::)' |
85 future = list(unfi.set(revset, pushop.futureheads, droots)) |
81 future = list(unfi.set(revset, pushop.futureheads, droots)) |