Add a --unmanaged flag to gclient config to allow the main solution to be unmanaged by the scm.

The dependencies will continue to be managed. A new flag is present in the .gclient file to control this behavior.

Review URL: http://codereview.chromium.org/7918027

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@102002 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/gclient_scm.py b/gclient_scm.py
index 3c6e173..ded662e 100644
--- a/gclient_scm.py
+++ b/gclient_scm.py
@@ -174,9 +174,13 @@
     url, deps_revision = gclient_utils.SplitUrlRevision(self.url)
     rev_str = ""
     revision = deps_revision
+    managed = True
     if options.revision:
       # Override the revision number.
       revision = str(options.revision)
+    if revision == 'unmanaged':
+      revision = None
+      managed = False
     if not revision:
       revision = default_rev
 
@@ -218,6 +222,10 @@
         print('')
       return
 
+    if not managed:
+      print ('________ unmanaged solution; skipping %s' % self.relpath)
+      return
+
     if not os.path.exists(os.path.join(self.checkout_path, '.git')):
       raise gclient_utils.Error('\n____ %s%s\n'
                                 '\tPath is not a git repo. No .git dir.\n'
@@ -735,14 +743,19 @@
     url, revision = gclient_utils.SplitUrlRevision(self.url)
     # Keep the original unpinned url for reference in case the repo is switched.
     base_url = url
+    managed = True
     if options.revision:
       # Override the revision number.
       revision = str(options.revision)
     if revision:
-      forced_revision = True
-      # Reconstruct the url.
-      url = '%s@%s' % (url, revision)
-      rev_str = ' at %s' % revision
+      if revision != 'unmanaged':
+        forced_revision = True
+        # Reconstruct the url.
+        url = '%s@%s' % (url, revision)
+        rev_str = ' at %s' % revision
+      else:
+        managed = False
+        revision = None
     else:
       forced_revision = False
       rev_str = ''
@@ -754,6 +767,10 @@
       self._RunAndGetFileList(command, options, file_list, self._root_dir)
       return
 
+    if not managed:
+      print ('________ unmanaged solution; skipping %s' % self.relpath)
+      return
+
     # Get the existing scm url and the revision number of the current checkout.
     try:
       from_info = scm.SVN.CaptureInfo(os.path.join(self.checkout_path, '.'))