summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authordilmah@chromium.org <dilmah@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 17:36:30 +0000
committerdilmah@chromium.org <dilmah@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 17:36:30 +0000
commit303a11ca6b91aa50b08d257c81f6f195ff9ba98c (patch)
tree6c21001b7e9f8cd70638a4bb902ed0b298bd7d1b /build
parentb4d084526b73c9fdff84101259c12b0e88478dc2 (diff)
downloadchromium_src-303a11ca6b91aa50b08d257c81f6f195ff9ba98c.zip
chromium_src-303a11ca6b91aa50b08d257c81f6f195ff9ba98c.tar.gz
chromium_src-303a11ca6b91aa50b08d257c81f6f195ff9ba98c.tar.bz2
Try harder to determine lastchange in case of git-svn repository with some local changes.
BUG=http://crosbug.com/7254 TEST=Manual Review URL: http://codereview.chromium.org/3570006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61526 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/util/lastchange.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/build/util/lastchange.py b/build/util/lastchange.py
index 8f1fb64..00b275f 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):