Mercurial > evolve
comparison hgext3rd/topic/discovery.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 |
---|---|
6 from . import topicmap | 6 from . import topicmap |
7 | 7 |
8 def _headssummary(orig, repo, remote, outgoing): | 8 def _headssummary(orig, repo, remote, outgoing): |
9 publishing = ('phases' not in remote.listkeys('namespaces') | 9 publishing = ('phases' not in remote.listkeys('namespaces') |
10 or bool(remote.listkeys('phases').get('publishing', False))) | 10 or bool(remote.listkeys('phases').get('publishing', False))) |
11 if publishing: | 11 if publishing or not remote.capable('topics'): |
12 return orig(repo, remote, outgoing) | 12 return orig(repo, remote, outgoing) |
13 oldgetitem = repo.__getitem__ | 13 oldgetitem = repo.__getitem__ |
14 oldrepo = repo.__class__ | 14 oldrepo = repo.__class__ |
15 oldbranchcache = branchmap.branchcache | 15 oldbranchcache = branchmap.branchcache |
16 oldfilename = branchmap._filename | 16 oldfilename = branchmap._filename |
100 hascheck = any(p.type == 'check:heads' for p in bundler._parts) | 100 hascheck = any(p.type == 'check:heads' for p in bundler._parts) |
101 if pushop.outdatedphases and not hascheck: | 101 if pushop.outdatedphases and not hascheck: |
102 exchange._pushb2ctxcheckheads(pushop, bundler) | 102 exchange._pushb2ctxcheckheads(pushop, bundler) |
103 return orig(pushop, bundler) | 103 return orig(pushop, bundler) |
104 | 104 |
105 def wireprotocaps(orig, repo, proto): | |
106 caps = orig(repo, proto) | |
107 if repo.peer().capable('topics'): | |
108 caps.append('topics') | |
109 return caps | |
105 | 110 |
106 | 111 |