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
1diff --git a/utilities/format-new-and-modified-imports b/utilities/format-new-and-modified-imports
2index d33d538..77185ce 100755
3--- a/utilities/format-new-and-modified-imports
4+++ b/utilities/format-new-and-modified-imports
5@@ -1,13 +1,8 @@
6-#!/usr/bin/env bash
7-#
8-# Reformat imports in new and modified files. Call without arguments
9-# to operate on uncommitted changes. Arguments will be passed to bzr
10-# status, so to operate on all new and modified files relative to the
11-# submit branch, use:
12-#
13-# format-new-and-modified-imports -r submit:
14+#! /bin/sh
15 #
16+# Reformat imports in new and modified files.
17
18-bzr status --short "$@" | \
19- awk '/^.[MN] .*[.]py$/ { print $NF }' | \
20+"$(dirname "$0")/find-changed-files.sh" | \
21+ xargs -n1 | \
22+ grep '\.py$' | \
23 xargs -r "$(dirname "$0")/format-imports"

Subscribers

People subscribed via source and target branches

to status/vote changes: