mercurial/exchange.py
changeset 37647 516b5a5edae3
parent 37646 72e26319f3b8
child 37648 8f3c6fb55369
equal deleted inserted replaced
37646:72e26319f3b8 37647:516b5a5edae3
  1210 
  1210 
  1211         # filter heads already turned public by the push
  1211         # filter heads already turned public by the push
  1212         outdated = [c for c in outdated if c.node() not in pheads]
  1212         outdated = [c for c in outdated if c.node() not in pheads]
  1213         # fallback to independent pushkey command
  1213         # fallback to independent pushkey command
  1214         for newremotehead in outdated:
  1214         for newremotehead in outdated:
  1215             r = pushop.remote.pushkey('phases',
  1215             with pushop.remote.commandexecutor() as e:
  1216                                       newremotehead.hex(),
  1216                 r = e.callcommand('pushkey', {
  1217                                       ('%d' % phases.draft),
  1217                     'namespace': 'phases',
  1218                                       ('%d' % phases.public))
  1218                     'key': newremotehead.hex(),
       
  1219                     'old': '%d' % phases.draft,
       
  1220                     'new': '%d' % phases.public
       
  1221                 }).result()
       
  1222 
  1219             if not r:
  1223             if not r:
  1220                 pushop.ui.warn(_('updating %s to public failed!\n')
  1224                 pushop.ui.warn(_('updating %s to public failed!\n')
  1221                                % newremotehead)
  1225                                % newremotehead)
  1222 
  1226 
  1223 def _localphasemove(pushop, nodes, phase=phases.public):
  1227 def _localphasemove(pushop, nodes, phase=phases.public):
  1268         action = 'update'
  1272         action = 'update'
  1269         if not old:
  1273         if not old:
  1270             action = 'export'
  1274             action = 'export'
  1271         elif not new:
  1275         elif not new:
  1272             action = 'delete'
  1276             action = 'delete'
  1273         if remote.pushkey('bookmarks', b, old, new):
  1277 
       
  1278         with remote.commandexecutor() as e:
       
  1279             r = e.callcommand('pushkey', {
       
  1280                 'namespace': 'bookmarks',
       
  1281                 'key': b,
       
  1282                 'old': old,
       
  1283                 'new': new,
       
  1284             }).result()
       
  1285 
       
  1286         if r:
  1274             ui.status(bookmsgmap[action][0] % b)
  1287             ui.status(bookmsgmap[action][0] % b)
  1275         else:
  1288         else:
  1276             ui.warn(bookmsgmap[action][1] % b)
  1289             ui.warn(bookmsgmap[action][1] % b)
  1277             # discovery can have set the value form invalid entry
  1290             # discovery can have set the value form invalid entry
  1278             if pushop.bkresult is not None:
  1291             if pushop.bkresult is not None: