Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4296)

Unified Diff: build/util/lastchange.py

Issue 3570006: Try harder to determine lastchange in case of git-svn repository with some local changes. (Closed)
Patch Set: tweak Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/util/lastchange.py
diff --git a/build/util/lastchange.py b/build/util/lastchange.py
index 8f1fb646d379515e4dddc58569043ac7d97288ad..00b275f0bd89f706e640e37f6d4b4b13dc39d59b 100644
--- a/build/util/lastchange.py
+++ b/build/util/lastchange.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -43,21 +43,23 @@ def git_fetch_id():
Errors are swallowed.
"""
+ git_re = re.compile('^\s*git-svn-id:\s+(\S+)@(\d+)', re.M)
try:
- p = subprocess.Popen(['git', 'log', '-1'],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- shell=(sys.platform=='win32'))
+ proc = subprocess.Popen(['git', 'log', '-999'],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE,
+ shell=(sys.platform=='win32'))
+ for line in proc.stdout:
+ match = git_re.search(line)
+ if match:
+ id = match.group(2)
+ if id:
+ proc.stdout.close() # Cut pipe.
+ return id
except OSError:
# 'git' is apparently either not installed or not executable.
- return None
- id = None
- if p:
- git_re = re.compile('^\s*git-svn-id:\s+(\S+)@(\d+)', re.M)
- m = git_re.search(p.stdout.read())
- if m:
- id = m.group(2)
- return id
+ pass
+ return None
def fetch_change(default_lastchange):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698