mercurial/exchange.py
changeset 51581 e0194b3ea312
parent 51577 b5d494f7d28a
child 51583 22cc679a7312
equal deleted inserted replaced
51580:b70628a9aa7e 51581:e0194b3ea312
  1306         remotephases = {b'publishing': b'True'}
  1306         remotephases = {b'publishing': b'True'}
  1307     if not remotephases:  # old server or public only reply from non-publishing
  1307     if not remotephases:  # old server or public only reply from non-publishing
  1308         _localphasemove(pushop, cheads)
  1308         _localphasemove(pushop, cheads)
  1309         # don't push any phase data as there is nothing to push
  1309         # don't push any phase data as there is nothing to push
  1310     else:
  1310     else:
  1311         ana = phases.analyzeremotephases(pushop.repo, cheads, remotephases)
  1311         unfi = pushop.repo.unfiltered()
  1312         pheads, droots = ana
  1312         to_rev = unfi.changelog.index.rev
       
  1313         to_node = unfi.changelog.node
       
  1314         cheads_revs = [to_rev(n) for n in cheads]
       
  1315         pheads_revs, _dr = phases.analyze_remote_phases(
       
  1316             pushop.repo,
       
  1317             cheads_revs,
       
  1318             remotephases,
       
  1319         )
       
  1320         pheads = [to_node(r) for r in pheads_revs]
  1313         ### Apply remote phase on local
  1321         ### Apply remote phase on local
  1314         if remotephases.get(b'publishing', False):
  1322         if remotephases.get(b'publishing', False):
  1315             _localphasemove(pushop, cheads)
  1323             _localphasemove(pushop, cheads)
  1316         else:  # publish = False
  1324         else:  # publish = False
  1317             _localphasemove(pushop, pheads)
  1325             _localphasemove(pushop, pheads)
  2061     if b'phases' in pullop.stepsdone:
  2069     if b'phases' in pullop.stepsdone:
  2062         return
  2070         return
  2063     pullop.stepsdone.add(b'phases')
  2071     pullop.stepsdone.add(b'phases')
  2064     publishing = bool(remotephases.get(b'publishing', False))
  2072     publishing = bool(remotephases.get(b'publishing', False))
  2065     if remotephases and not publishing:
  2073     if remotephases and not publishing:
       
  2074         unfi = pullop.repo.unfiltered()
       
  2075         to_rev = unfi.changelog.index.rev
       
  2076         to_node = unfi.changelog.node
       
  2077         pulledsubset_revs = [to_rev(n) for n in pullop.pulledsubset]
  2066         # remote is new and non-publishing
  2078         # remote is new and non-publishing
  2067         pheads, _dr = phases.analyzeremotephases(
  2079         pheads_revs, _dr = phases.analyze_remote_phases(
  2068             pullop.repo, pullop.pulledsubset, remotephases
  2080             pullop.repo,
       
  2081             pulledsubset_revs,
       
  2082             remotephases,
  2069         )
  2083         )
       
  2084         pheads = [to_node(r) for r in pheads_revs]
  2070         dheads = pullop.pulledsubset
  2085         dheads = pullop.pulledsubset
  2071     else:
  2086     else:
  2072         # Remote is old or publishing all common changesets
  2087         # Remote is old or publishing all common changesets
  2073         # should be seen as public
  2088         # should be seen as public
  2074         pheads = pullop.pulledsubset
  2089         pheads = pullop.pulledsubset