Mercurial > evolve
comparison hgext3rd/topic/__init__.py @ 1903:58cdf061d49a
topic: don't take topic into account when pushing to non-topic repo
Previously, pushing to a non-publishing repository without topic support would
wrongfully use topic when searching for new heads.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 15 Mar 2016 17:26:57 +0000 |
parents | 85390446f8c1 |
children | f52c02bf47b7 |
comparison
equal
deleted
inserted
replaced
1902:93cf0ddb5234 | 1903:58cdf061d49a |
---|---|
92 def reposetup(ui, repo): | 92 def reposetup(ui, repo): |
93 orig = repo.__class__ | 93 orig = repo.__class__ |
94 if not isinstance(repo, localrepo.localrepository): | 94 if not isinstance(repo, localrepo.localrepository): |
95 return # this can be a peer in the ssh case (puzzling) | 95 return # this can be a peer in the ssh case (puzzling) |
96 class topicrepo(repo.__class__): | 96 class topicrepo(repo.__class__): |
97 | |
98 def _restrictcapabilities(self, caps): | |
99 caps = super(topicrepo, self)._restrictcapabilities(caps) | |
100 caps.add('topics') | |
101 return caps | |
102 | |
97 def commit(self, *args, **kwargs): | 103 def commit(self, *args, **kwargs): |
98 backup = self.ui.backupconfig('ui', 'allowemptycommit') | 104 backup = self.ui.backupconfig('ui', 'allowemptycommit') |
99 try: | 105 try: |
100 if repo.currenttopic != repo['.'].topic(): | 106 if repo.currenttopic != repo['.'].topic(): |
101 # bypass the core "nothing changed" logic | 107 # bypass the core "nothing changed" logic |
322 | 328 |
323 extensions.wrapfunction(cmdutil, 'buildcommittext', committextwrap) | 329 extensions.wrapfunction(cmdutil, 'buildcommittext', committextwrap) |
324 extensions.wrapfunction(merge, 'update', mergeupdatewrap) | 330 extensions.wrapfunction(merge, 'update', mergeupdatewrap) |
325 extensions.wrapfunction(discoverymod, '_headssummary', discovery._headssummary) | 331 extensions.wrapfunction(discoverymod, '_headssummary', discovery._headssummary) |
326 extensions.wrapfunction(wireproto, 'branchmap', discovery.wireprotobranchmap) | 332 extensions.wrapfunction(wireproto, 'branchmap', discovery.wireprotobranchmap) |
333 extensions.wrapfunction(wireproto, '_capabilities', discovery.wireprotocaps) | |
327 extensions.wrapfunction(bundle2, 'handlecheckheads', discovery.handlecheckheads) | 334 extensions.wrapfunction(bundle2, 'handlecheckheads', discovery.handlecheckheads) |
328 bundle2.handlecheckheads.params = frozenset() # we need a proper wrape b2 part stuff | 335 bundle2.handlecheckheads.params = frozenset() # we need a proper wrape b2 part stuff |
329 bundle2.parthandlermapping['check:heads'] = bundle2.handlecheckheads | 336 bundle2.parthandlermapping['check:heads'] = bundle2.handlecheckheads |
330 extensions.wrapfunction(exchange, '_pushb2phases', discovery._pushb2phases) | 337 extensions.wrapfunction(exchange, '_pushb2phases', discovery._pushb2phases) |
331 extensions.wrapfunction(changegroup.cg1unpacker, 'apply', cgapply) | 338 extensions.wrapfunction(changegroup.cg1unpacker, 'apply', cgapply) |