hgext/simple4server.py
branchstable
changeset 1602 f932853783a5
parent 1548 4229d1dae5ad
child 1713 00612a019547
equal deleted inserted replaced
1584:190e4e526c66 1602:f932853783a5
    32     from mercurial import obsolete
    32     from mercurial import obsolete
    33     from mercurial import wireproto
    33     from mercurial import wireproto
    34     gboptslist = getattr(wireproto, 'gboptslist', None)
    34     gboptslist = getattr(wireproto, 'gboptslist', None)
    35     gboptsmap = getattr(wireproto, 'gboptsmap', None)
    35     gboptsmap = getattr(wireproto, 'gboptsmap', None)
    36 except (ImportError, AttributeError):
    36 except (ImportError, AttributeError):
    37     raise util.Abort('Your Mercurial is too old for this version of Evolve\n'
    37     raise error.Abort('Your Mercurial is too old for this version of Evolve\n'
    38                      'requires version 3.0.1 or above')
    38                       'requires version 3.0.1 or above')
    39 
    39 
    40 # Start of simple4server specific content
    40 # Start of simple4server specific content
    41 
    41 
    42 from mercurial import pushkey
    42 from mercurial import pushkey
    43 
    43 
    99     return obsdata
    99     return obsdata
   100 
   100 
   101 if not util.safehasattr(obsolete.obsstore, 'relevantmarkers'):
   101 if not util.safehasattr(obsolete.obsstore, 'relevantmarkers'):
   102     # from evolve extension: 1a23c7c52a43
   102     # from evolve extension: 1a23c7c52a43
   103     class pruneobsstore(obsolete.obsstore):
   103     class pruneobsstore(obsolete.obsstore):
   104         """And extended obsstore class that read parent information from v1 format
   104         """And extended obsstore class that read parent information from v1
   105 
   105         format
   106         Evolve extension adds parent information in prune marker. We use it to make
   106 
   107         markers relevant to pushed changeset."""
   107         Evolve extension adds parent information in prune marker.
       
   108         We use it to make markers relevant to pushed changeset."""
   108 
   109 
   109         def __init__(self, *args, **kwargs):
   110         def __init__(self, *args, **kwargs):
   110             self.prunedchildren = {}
   111             self.prunedchildren = {}
   111             return super(pruneobsstore, self).__init__(*args, **kwargs)
   112             return super(pruneobsstore, self).__init__(*args, **kwargs)
   112 
   113 
   235 def srv_obshash(repo, proto, nodes):
   236 def srv_obshash(repo, proto, nodes):
   236     return wireproto.encodelist(_obshash(repo, wireproto.decodelist(nodes)))
   237     return wireproto.encodelist(_obshash(repo, wireproto.decodelist(nodes)))
   237 
   238 
   238 # from evolve extension: 3249814dabd1
   239 # from evolve extension: 3249814dabd1
   239 def srv_obshash1(repo, proto, nodes):
   240 def srv_obshash1(repo, proto, nodes):
   240     return wireproto.encodelist(_obshash(repo, wireproto.decodelist(nodes), version=1))
   241     return wireproto.encodelist(_obshash(repo, wireproto.decodelist(nodes),
       
   242                                 version=1))
   241 
   243 
   242 # from evolve extension: 3249814dabd1
   244 # from evolve extension: 3249814dabd1
   243 def capabilities(orig, repo, proto):
   245 def capabilities(orig, repo, proto):
   244     """wrapper to advertise new capability"""
   246     """wrapper to advertise new capability"""
   245     caps = orig(repo, proto)
   247     caps = orig(repo, proto)