Merge lp:~mhall119/devscripts/allow-edit-patch-sh into lp:devscripts

Proposed by Michael Hall on 2012-03-09
Status: Rejected
Rejected by: Benjamin Drung on 2012-03-09
Proposed branch: lp:~mhall119/devscripts/allow-edit-patch-sh
Merge into: lp:devscripts
Diff against target: 36 lines (+8/-3)
1 file modified
scripts/edit-patch.sh (+8/-3)
To merge this branch: bzr merge lp:~mhall119/devscripts/allow-edit-patch-sh
Reviewer Review Type Date Requested Status
devscripts developers 2012-03-09 Pending
Review via email: mp+96692@code.launchpad.net

Description of the Change

Running scripts/edit-patch.sh, because it checks if basename $0 is "edit-patch", which it will be when installed to /usr/bin, but not prior.

This patch will strip any trailing .sh from the filename before matching, so /usr/bin/edit-patch or ./devscripts/scripts/edit-patch.sh will match, but edit-patch.sh.foo will not.

To post a comment you must log in.
Benjamin Drung (bdrung) wrote :

It's merged in Debian

Unmerged revisions

2348. By Michael Hall on 2012-03-09

Remove trailing .sh when checking if the script is being run as edit-patch or add-patch

2347. By Michael Hall on 2012-03-05

Save the top patch on the quilt stack, and go back to that after adding/editing a patch before committing changes to vcs

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/edit-patch.sh'
2--- scripts/edit-patch.sh 2011-05-21 21:35:20 +0000
3+++ scripts/edit-patch.sh 2012-03-09 01:00:25 +0000
4@@ -121,6 +121,8 @@
5
6 edit_patch_quilt() {
7 export QUILT_PATCHES=debian/patches
8+ top_patch=$(quilt top)
9+ echo "Top patch: $top_patch"
10 if [ -e $PREFIX/$1 ]; then
11 # if its a existing patch and we are at the end of the stack,
12 # go back at the beginning
13@@ -138,7 +140,8 @@
14 # use a sub-shell
15 quilt shell
16 quilt refresh
17- quilt pop -a
18+ echo "Reverting quilt back to $top_patch"
19+ quilt pop $top_patch
20 vcs_add $PREFIX/$1 $PREFIX/series
21 }
22
23@@ -290,9 +293,11 @@
24 normalize_patch_path
25 normalize_patch_extension
26 handle_file_patch
27- if [ "$(basename $0)" = "edit-patch" ]; then
28+ if [ "$(basename $0|sed -e s/.sh\$//)" = "edit-patch" ]; then
29+ echo "Found edit-patch"
30 edit_patch_$PATCHSYSTEM $PATCHNAME
31- elif [ "$(basename $0)" = "add-patch" ]; then
32+ elif [ "$(basename $0|sed -e s/.sh\$//)" = "add-patch" ]; then
33+ echo "Found add-patch"
34 add_patch_$PATCHSYSTEM $1 $PATCHNAME
35 fi
36 add_patch_tagging $PATCHNAME

Subscribers

People subscribed via source and target branches

to all changes: