-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ls/import/get: introduce --remote and --remote-config
Fixes #9656
- Loading branch information
Showing
11 changed files
with
222 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,32 @@ | ||
def imp(self, url, path, out=None, rev=None, config=None, **kwargs): | ||
def imp( | ||
self, | ||
url, | ||
path, | ||
out=None, | ||
rev=None, | ||
config=None, | ||
remote=None, | ||
remote_config=None, | ||
**kwargs, | ||
): | ||
erepo = {"url": url} | ||
if rev is not None: | ||
erepo["rev"] = rev | ||
|
||
if config is not None: | ||
erepo["config"] = config | ||
|
||
if remote is not None and remote_config is not None: | ||
conf = erepo.get("config") or {} | ||
remotes = conf.get("remote") or {} | ||
remote_conf = remotes.get(remote) or {} | ||
remote_conf.update(remote_config) | ||
remotes[remote] = remote_conf | ||
conf["remote"] = remotes | ||
erepo["config"] = conf | ||
elif remote is not None: | ||
erepo["remote"] = remote | ||
elif remote_config is not None: | ||
erepo["remote"] = remote_config | ||
|
||
return self.imp_url(path, out=out, erepo=erepo, frozen=True, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.