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

Unified Diff: scm.py

Issue 3446014: Improve GIT.CaptureStatus() to work with incorrectly merged local branches. (Closed)
Patch Set: Created 10 years, 3 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: scm.py
diff --git a/scm.py b/scm.py
index 5b2c8eafa10277241d8fd41eeb54db3bfbff8c77..00364cae4c82f2bf181db2f5ffca83626857a518 100644
--- a/scm.py
+++ b/scm.py
@@ -92,11 +92,15 @@ class GIT(object):
results = []
if status:
for statusline in status.splitlines():
- m = re.match('^(\w)\t(.+)$', statusline)
+ # 3-way merges can cause the status can be 'MMM' instead of 'M'. This
+ # can happen when the user has 2 local branches and he diffs between
+ # these 2 branches instead diffing to upstream.
+ m = re.match('^(\w)+\t(.+)$', statusline)
if not m:
raise gclient_utils.Error(
'status currently unsupported: %s' % statusline)
- results.append(('%s ' % m.group(1), m.group(2)))
+ # Only grab the first letter.
+ results.append(('%s ' % m.group(1)[0], m.group(2)))
return results
@staticmethod
« 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