Merge ~cjwatson/launchpad:format-new-and-modified-imports-git into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 5981419d5a33d03f51f414d91ce930fd1fd59524
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:format-new-and-modified-imports-git
Merge into: launchpad:master
Diff against target: 23 lines (+5/-10)
1 file modified
utilities/format-new-and-modified-imports (+5/-10)
Reviewer Review Type Date Requested Status
Tom Wardill (community) Approve
Review via email: mp+373627@code.launchpad.net

Commit message

Port format-new-and-modified-imports to git

The argument handling wasn't very useful (if you need that then you can
always just run utilities/format-imports directly), so I dropped it in
favour of utilities/find-changed-files.sh.

To post a comment you must log in.
Revision history for this message
Tom Wardill (twom) wrote :

works for me!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/utilities/format-new-and-modified-imports b/utilities/format-new-and-modified-imports
index d33d538..77185ce 100755
--- a/utilities/format-new-and-modified-imports
+++ b/utilities/format-new-and-modified-imports
@@ -1,13 +1,8 @@
1#!/usr/bin/env bash1#! /bin/sh
2#
3# Reformat imports in new and modified files. Call without arguments
4# to operate on uncommitted changes. Arguments will be passed to bzr
5# status, so to operate on all new and modified files relative to the
6# submit branch, use:
7#
8# format-new-and-modified-imports -r submit:
9#2#
3# Reformat imports in new and modified files.
104
11bzr status --short "$@" | \5"$(dirname "$0")/find-changed-files.sh" | \
12 awk '/^.[MN] .*[.]py$/ { print $NF }' | \6 xargs -n1 | \
7 grep '\.py$' | \
13 xargs -r "$(dirname "$0")/format-imports"8 xargs -r "$(dirname "$0")/format-imports"

Subscribers

People subscribed via source and target branches

to status/vote changes: