summaryrefslogtreecommitdiffstats
path: root/gitc_utils.py
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-10-06 15:23:19 -0700
committerDan Willemsen <dwillemsen@google.com>2015-10-07 15:43:22 -0700
commit745b4ad660f8050045b521c4e15b7d3ac0b3d70e (patch)
tree643e836eafdde0c08e1eec540eab6ae23b2ef29e /gitc_utils.py
parent4c5f74e4521679d1dcc31c575d417387b9c51c87 (diff)
downloadgit-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.py12
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
24import git_config 24import git_config
25import wrapper 25import wrapper
26 26
27GITC_FS_ROOT_DIR = '/gitc/manifest-rw/'
28NUM_BATCH_RETRIEVE_REVISIONID = 300 27NUM_BATCH_RETRIEVE_REVISIONID = 300
29 28
30def get_gitc_manifest_dir(): 29def get_gitc_manifest_dir():
31 return wrapper.Wrapper().get_gitc_manifest_dir() 30 return wrapper.Wrapper().get_gitc_manifest_dir()
32 31
33def parse_clientdir(gitc_fs_path): 32def 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
45def _set_project_revisions(projects): 35def _set_project_revisions(projects):
46 """Sets the revisionExpr for a list of projects. 36 """Sets the revisionExpr for a list of projects.