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

Unified Diff: tools/git/mass-rename.py

Issue 2807813002: tools: Make mass-rename.py print progress as it works (Closed)
Patch Set: enumerate Created 3 years, 8 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: tools/git/mass-rename.py
diff --git a/tools/git/mass-rename.py b/tools/git/mass-rename.py
index 21fbef76b722063d3933ac9eb7b46b6034da91b2..d6aa8efe4d61f110fe0346bfa1271cd4954061bb 100755
--- a/tools/git/mass-rename.py
+++ b/tools/git/mass-rename.py
@@ -28,13 +28,18 @@ def main():
out, _ = popen.communicate()
if popen.returncode != 0:
return 1
- for line in out.splitlines():
+ lines = out.splitlines()
+ for item, line in enumerate(lines, 1):
+ # Print progress
+ print '[%d/%d]' % (item, len(lines)),
+
parts = line.split('\t')
if len(parts) != 3:
print 'Skipping: %s -- not a rename?' % parts
continue
attrs, fro, to = parts
if attrs.split()[4].startswith('R'):
+ print 'Moving: %s' % fro
subprocess.check_call([
sys.executable,
os.path.join(BASE_DIR, 'move_source_file.py'),
« 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