Details
Details
- Reviewers
durin42 - Group Reviewers
hg-reviewers - Commits
- rHG0e50dda7e9c1: logexchange: use command executor for wire protocol commands
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
durin42 |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/logexchange.py (13 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg | ||
Closed | indygreg |
def pullremotenames(localrepo, remoterepo): | def pullremotenames(localrepo, remoterepo): | ||||
""" | """ | ||||
pulls bookmarks and branches information of the remote repo during a | pulls bookmarks and branches information of the remote repo during a | ||||
pull or clone operation. | pull or clone operation. | ||||
localrepo is our local repository | localrepo is our local repository | ||||
remoterepo is the peer instance | remoterepo is the peer instance | ||||
""" | """ | ||||
remotepath = activepath(localrepo, remoterepo) | remotepath = activepath(localrepo, remoterepo) | ||||
bookmarks = remoterepo.listkeys('bookmarks') | |||||
with remoterepo.commandexecutor() as e: | |||||
bookmarks = e.callcommand('listkeys', { | |||||
'namespace': 'bookmarks', | |||||
}).result() | |||||
# on a push, we don't want to keep obsolete heads since | # on a push, we don't want to keep obsolete heads since | ||||
# they won't show up as heads on the next pull, so we | # they won't show up as heads on the next pull, so we | ||||
# remove them here otherwise we would require the user | # remove them here otherwise we would require the user | ||||
# to issue a pull to refresh the storage | # to issue a pull to refresh the storage | ||||
bmap = {} | bmap = {} | ||||
repo = localrepo.unfiltered() | repo = localrepo.unfiltered() | ||||
for branch, nodes in remoterepo.branchmap().iteritems(): | |||||
with remoterepo.commandexecutor() as e: | |||||
branchmap = e.callcommand('branchmap', {}).result() | |||||
for branch, nodes in branchmap.iteritems(): | |||||
bmap[branch] = [] | bmap[branch] = [] | ||||
for node in nodes: | for node in nodes: | ||||
if node in repo and not repo[node].obsolete(): | if node in repo and not repo[node].obsolete(): | ||||
bmap[branch].append(hex(node)) | bmap[branch].append(hex(node)) | ||||
saveremotenames(localrepo, remotepath, bmap, bookmarks) | saveremotenames(localrepo, remotepath, bmap, bookmarks) |