diff options
author | Dan Willemsen <dwillemsen@google.com> | 2015-10-06 15:23:19 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2015-10-07 15:43:22 -0700 |
commit | 745b4ad660f8050045b521c4e15b7d3ac0b3d70e (patch) | |
tree | 643e836eafdde0c08e1eec540eab6ae23b2ef29e /gitc_utils.py | |
parent | 4c5f74e4521679d1dcc31c575d417387b9c51c87 (diff) | |
download | git-repo-745b4ad660f8050045b521c4e15b7d3ac0b3d70e.tar.gz |
Fix gitc-init behaviorv1.12.32
With gitc-init, a gitc client may be specified using '-c'. If we're
not currently in that client, we need to change directories so that
we don't affect the local checkout, and to ensure that repo is
checked out in the new client.
This also makes '-c' optional if already in a gitc client, to match
the rest of the init options.
Change-Id: Ib514ad9fd101698060ae89bb035499800897e9bd
Diffstat (limited to 'gitc_utils.py')
-rw-r--r-- | gitc_utils.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/gitc_utils.py b/gitc_utils.py index dd38f890..0f3e1818 100644 --- a/gitc_utils.py +++ b/gitc_utils.py | |||
@@ -24,23 +24,13 @@ import git_command | |||
24 | import git_config | 24 | import git_config |
25 | import wrapper | 25 | import wrapper |
26 | 26 | ||
27 | GITC_FS_ROOT_DIR = '/gitc/manifest-rw/' | ||
28 | NUM_BATCH_RETRIEVE_REVISIONID = 300 | 27 | NUM_BATCH_RETRIEVE_REVISIONID = 300 |
29 | 28 | ||
30 | def get_gitc_manifest_dir(): | 29 | def get_gitc_manifest_dir(): |
31 | return wrapper.Wrapper().get_gitc_manifest_dir() | 30 | return wrapper.Wrapper().get_gitc_manifest_dir() |
32 | 31 | ||
33 | def parse_clientdir(gitc_fs_path): | 32 | def parse_clientdir(gitc_fs_path): |
34 | """Parse a path in the GITC FS and return its client name. | 33 | return wrapper.Wrapper().gitc_parse_clientdir(gitc_fs_path) |
35 | |||
36 | @param gitc_fs_path: A subdirectory path within the GITC_FS_ROOT_DIR. | ||
37 | |||
38 | @returns: The GITC client name | ||
39 | """ | ||
40 | if (gitc_fs_path == GITC_FS_ROOT_DIR or | ||
41 | not gitc_fs_path.startswith(GITC_FS_ROOT_DIR)): | ||
42 | return None | ||
43 | return gitc_fs_path.split(GITC_FS_ROOT_DIR)[1].split('/')[0] | ||
44 | 34 | ||
45 | def _set_project_revisions(projects): | 35 | def _set_project_revisions(projects): |
46 | """Sets the revisionExpr for a list of projects. | 36 | """Sets the revisionExpr for a list of projects. |