From 745b4ad660f8050045b521c4e15b7d3ac0b3d70e Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 6 Oct 2015 15:23:19 -0700 Subject: Fix gitc-init behavior 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 --- gitc_utils.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'gitc_utils.py') 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 import git_config import wrapper -GITC_FS_ROOT_DIR = '/gitc/manifest-rw/' NUM_BATCH_RETRIEVE_REVISIONID = 300 def get_gitc_manifest_dir(): return wrapper.Wrapper().get_gitc_manifest_dir() def parse_clientdir(gitc_fs_path): - """Parse a path in the GITC FS and return its client name. - - @param gitc_fs_path: A subdirectory path within the GITC_FS_ROOT_DIR. - - @returns: The GITC client name - """ - if (gitc_fs_path == GITC_FS_ROOT_DIR or - not gitc_fs_path.startswith(GITC_FS_ROOT_DIR)): - return None - return gitc_fs_path.split(GITC_FS_ROOT_DIR)[1].split('/')[0] + return wrapper.Wrapper().gitc_parse_clientdir(gitc_fs_path) def _set_project_revisions(projects): """Sets the revisionExpr for a list of projects. -- cgit v1.2.3-54-g00ecf