summaryrefslogtreecommitdiffstats
path: root/main.py
diff options
context:
space:
mode:
authorSimran Basi <sbasi@google.com>2015-08-20 12:19:28 -0700
committerDan Willemsen <dwillemsen@google.com>2015-08-28 10:53:05 -0700
commitb9a1b73425773dc97843f92aeee9c57c9a08c0f7 (patch)
tree592a3655e92af8c7265ba07e29ba35aa1a1a36a8 /main.py
parentdc2545cad60d7e8bae894f5d60eaeb3cff7485ae (diff)
downloadgit-repo-b9a1b73425773dc97843f92aeee9c57c9a08c0f7.tar.gz
GITC: Add repo start support.
Add repo start support for GITC checkouts. If the user is in the GITC FS view, they can now run repo start to check out the sources and create a new working branch. When "repo start" is called on a GITC project, the revision tag is set to an empty string and saved in a new tag: old-revision. This tells the GITC filesystem to display the local copy of the sources when being viewed. The local copy is created by pulling the project sources and the new branch is created based off the original project revision. Updated main.py to setup each command's gitc_manifest when appropriate. Updated repo sync's logic to sync opened projects and updating the GITC manifest file for the rest. Change-Id: I7e4809d1c4fc43c69b26f2f1bebe45aab0cae628
Diffstat (limited to 'main.py')
-rwxr-xr-xmain.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.py b/main.py
index 6736abc9..adfaffb0 100755
--- a/main.py
+++ b/main.py
@@ -51,7 +51,8 @@ from error import ManifestParseError
51from error import NoManifestException 51from error import NoManifestException
52from error import NoSuchProjectError 52from error import NoSuchProjectError
53from error import RepoChangedException 53from error import RepoChangedException
54from manifest_xml import XmlManifest 54import gitc_utils
55from manifest_xml import GitcManifest, XmlManifest
55from pager import RunPager 56from pager import RunPager
56from wrapper import WrapperPath, Wrapper 57from wrapper import WrapperPath, Wrapper
57 58
@@ -129,6 +130,12 @@ class _Repo(object):
129 130
130 cmd.repodir = self.repodir 131 cmd.repodir = self.repodir
131 cmd.manifest = XmlManifest(cmd.repodir) 132 cmd.manifest = XmlManifest(cmd.repodir)
133 cmd.gitc_manifest = None
134 gitc_client_name = gitc_utils.parse_clientdir(os.getcwd())
135 if gitc_client_name:
136 cmd.gitc_manifest = GitcManifest(cmd.repodir, gitc_client_name)
137 cmd.manifest.isGitcClient = True
138
132 Editor.globalConfig = cmd.manifest.globalConfig 139 Editor.globalConfig = cmd.manifest.globalConfig
133 140
134 if not isinstance(cmd, MirrorSafeCommand) and cmd.manifest.IsMirror: 141 if not isinstance(cmd, MirrorSafeCommand) and cmd.manifest.IsMirror: