Chromium Code Reviews

Unified Diff: scm.py

Issue 6674059: Make sure warnings fail the check when may_prompt=False. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: moved determine_scm() Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: scm.py
diff --git a/scm.py b/scm.py
index 58f11b3de1b713e88cf833022c451ca5c4cec1c2..2156b293ded4fb3a6a1085299b78151a56a95b04 100644
--- a/scm.py
+++ b/scm.py
@@ -65,6 +65,24 @@ def GenFakeDiff(filename):
return result
+def determine_scm(root):
+ """Similar to upload.py's version but much simpler.
+
+ Returns 'svn', 'git' or None.
+ """
+ if os.path.isdir(os.path.join(root, '.svn')):
+ return 'svn'
+ elif os.path.isdir(os.path.join(root, '.svn')):
+ return 'git'
+ else:
+ if (0 == subprocess.call(
+ ['git', 'rev-parse', '--show-cdup'],
+ stdout=subprocess.PIPE, cwd=root)):
+ return 'git'
+ else:
+ return None
+
+
class GIT(object):
@staticmethod
def Capture(args, **kwargs):
« presubmit_support.py ('K') | « presubmit_support.py ('k') | tests/presubmit_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine