comparison mercurial/exchange.py @ 47492:f03e9d30258e

exchange: use "served" repo filter to guess what the server will publish Previously, the second push in the added test would say "push would publish 2 changesets" because _checkpublish() was considering secret changesets to be "pushable" when push command had a --rev argument. Without --rev argument to push command, we already filter the repo properly. Differential Revision: https://phab.mercurial-scm.org/D10948
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 03 Jul 2021 10:21:16 +0300
parents 19d4802cb304
children 7d1e60244561
comparison
equal deleted inserted replaced
47491:8851acad5906 47492:f03e9d30258e
182 182
183 if pushop.revs is None: 183 if pushop.revs is None:
184 published = repo.filtered(b'served').revs(b'not public()') 184 published = repo.filtered(b'served').revs(b'not public()')
185 else: 185 else:
186 published = repo.revs(b'::%ln - public()', pushop.revs) 186 published = repo.revs(b'::%ln - public()', pushop.revs)
187 # we want to use pushop.revs in the revset even if they themselves are
188 # secret, but we don't want to have anything that the server won't see
189 # in the result of this expression
190 published &= repo.filtered(b'served')
187 if published: 191 if published:
188 if behavior == b'warn': 192 if behavior == b'warn':
189 ui.warn( 193 ui.warn(
190 _(b'%i changesets about to be published\n') % len(published) 194 _(b'%i changesets about to be published\n') % len(published)
191 ) 195 )