hgext/evolve.py
changeset 1212 2c1b6e2ec59a
parent 1211 9523c027a240
child 1213 7118996bdf43
equal deleted inserted replaced
1208:46a465fb2aee 1212:2c1b6e2ec59a
  1420         # Create the new commit context
  1420         # Create the new commit context
  1421         repo.ui.status(_('computing new diff\n'))
  1421         repo.ui.status(_('computing new diff\n'))
  1422         files = set()
  1422         files = set()
  1423         copied = copies.pathcopies(prec, bumped)
  1423         copied = copies.pathcopies(prec, bumped)
  1424         precmanifest = prec.manifest()
  1424         precmanifest = prec.manifest()
  1425         for key, val in bumped.manifest().items():
  1425         # 3.3.2 needs a list.
  1426             if precmanifest.pop(key, None) != val:
  1426         # future 3.4 don't detect the size change during iteration
       
  1427         # this is fishy
       
  1428         for key, val in list(bumped.manifest().iteritems()):
       
  1429             precvalue = precmanifest.get(key, None)
       
  1430             if precvalue is not None:
       
  1431                 del precmanifest[key]
       
  1432             if precvalue != val:
  1427                 files.add(key)
  1433                 files.add(key)
  1428         files.update(precmanifest)  # add missing files
  1434         files.update(precmanifest)  # add missing files
  1429         # commit it
  1435         # commit it
  1430         if files: # something to commit!
  1436         if files: # something to commit!
  1431             def filectxfn(repo, ctx, path):
  1437             def filectxfn(repo, ctx, path):
  2517 def httpclient_pushobsmarkers(self, obsfile):
  2523 def httpclient_pushobsmarkers(self, obsfile):
  2518     """httpprotocol peer method
  2524     """httpprotocol peer method
  2519     (Cannot simply use _callpush as http is doing some special handling)"""
  2525     (Cannot simply use _callpush as http is doing some special handling)"""
  2520     self.requirecap('_evoext_pushobsmarkers_0',
  2526     self.requirecap('_evoext_pushobsmarkers_0',
  2521                     _('push obsolete markers faster'))
  2527                     _('push obsolete markers faster'))
  2522     ret, output = self._call('evoext_pushobsmarkers_0', data=obsfile)
  2528     try:
  2523     for l in output.splitlines(True):
  2529         r = self._call('evoext_pushobsmarkers_0', data=obsfile)
  2524         if l.strip():
  2530         vals = r.split('\n', 1)
  2525             self.ui.status(_('remote: '), l)
  2531         if len(vals) < 2:
  2526     return ret
  2532             raise error.ResponseError(_("unexpected response:"), r)
       
  2533 
       
  2534         for l in vals[1].splitlines(True):
       
  2535             if l.strip():
       
  2536                 self.ui.status(_('remote: '), l)
       
  2537         return vals[0]
       
  2538     except socket.error, err:
       
  2539         if err.args[0] in (errno.ECONNRESET, errno.EPIPE):
       
  2540             raise util.Abort(_('push failed: %s') % err.args[1])
       
  2541         raise util.Abort(err.args[1])
  2527 
  2542 
  2528 @eh.wrapfunction(localrepo.localrepository, '_restrictcapabilities')
  2543 @eh.wrapfunction(localrepo.localrepository, '_restrictcapabilities')
  2529 def local_pushobsmarker_capabilities(orig, repo, caps):
  2544 def local_pushobsmarker_capabilities(orig, repo, caps):
  2530     caps = orig(repo, caps)
  2545     caps = orig(repo, caps)
  2531     caps.add('_evoext_pushobsmarkers_0')
  2546     caps.add('_evoext_pushobsmarkers_0')