exchange: replace remotenames.important-names with selectivepull names

Summary: Now we have functions to get selectivepull names in core. Use that instead.

Reviewed By: markbt

Differential Revision: D20531118

fbshipit-source-id: a0c20c491baf1b0ad71e80f870703bb4b983f19c
This commit is contained in:
Jun Wu 2020-03-26 08:23:49 -07:00 committed by Facebook GitHub Bot
parent c7549d5b71
commit e105af5a54
3 changed files with 4 additions and 13 deletions

View File

@ -588,6 +588,5 @@ coreconfigitem("rebase", "singletransaction", default=False)
coreconfigitem("rebase", "experimental.inmemory", default=False)
# Remote names.
coreconfigitem("remotenames", "important-names", default=["master"])
coreconfigitem("remotenames", "selectivepulldefault", default=["master"])
coreconfigitem("remotenames", "autopullprefix", default=["remote/", "default/"])

View File

@ -1702,10 +1702,11 @@ def _pullbookmarks(pullop):
repo = pullop.repo
ui = repo.ui
# Update important remotenames (ex. remote/master) unconditionally.
# Update important remotenames (ex. remote/master) listed by selectivepull
# unconditionally.
remotename = ui.paths.getname(pullop.remote.url()) # ex. 'default' or 'remote'
if remotename is not None:
importantnames = ui.configlist("remotenames", "important-names")
importantnames = bookmod.selectivepullbookmarknames(repo, remotename)
remotebookmarks = pullop.remotebookmarks
newnames = {} # ex. {"master": hexnode}
for name in importantnames:
@ -1714,9 +1715,7 @@ def _pullbookmarks(pullop):
# The remotenames.saveremotenames API wants hexnames.
newnames[name] = hex(node)
from ..hgext.remotenames import saveremotenames
saveremotenames(repo, {remotename: newnames}, override=False)
bookmod.saveremotenames(repo, {remotename: newnames}, override=False)
# XXX: Ideally we update remotenames right here to avoid race
# conditions. See racy-pull-on-push in remotenames.py.

View File

@ -2113,13 +2113,6 @@ have a definite end point.
Default to False, when True allow creating divergence when performing
rebase of obsolete changesets.
``remotenames``
----------
``important-names``
A list of names that will be written to ``remotenames`` on pull.
(default: master)
``revsetalias``
---------------