summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-03-12 16:08:21 -0700
committerTrent Piepho <xyzzy@speakeasy.org>2007-03-12 16:08:21 -0700
commit7bc2a9de3848c0ea06877adcb53c29b9155840ef (patch)
treea0fcfb5748291b85e19213cb2f934209b337d51c
parent41956dcf341ea42e7990d39bfcebe860b1375538 (diff)
downloadmediapointer-dvb-s2-7bc2a9de3848c0ea06877adcb53c29b9155840ef.tar.gz
mediapointer-dvb-s2-7bc2a9de3848c0ea06877adcb53c29b9155840ef.tar.bz2
build: add a qrefresh target, like commit for use with mq
Adds a qrefresh target to the top-level Makefile. It's like commit, but for use with the Hg mq extension. It will execute hg qrefresh, so you should have a current mq patch created with hg qnew already! It will run the whitespace and cardlist scripts. If you do not have a commit message from the current mq patch, it will create a default one, as make commit does. If one already exists, then it will put a comment at the beginning of the existing message with the current diffstat and a note of any changes the whitespace script made. The diffstat is done with qdiff, which will show the total diffstat of the patch instead of just the diffstat of from the last version of the patch to the current version. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
-rw-r--r--Makefile7
-rwxr-xr-xv4l/scripts/prep_commit_msg.pl19
2 files changed, 25 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f0101af9a..fdccb41c0 100644
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,13 @@ commit cvscommit hgcommit change changes changelog:: whitespace
@hg log -v -r -1
@echo "*** If not ok, do hg undo and make commit again"
+qrefresh:: whitespace
+ cd $(BUILD_DIR); scripts/cardlist; cd ..
+ v4l/scripts/prep_commit_msg.pl -q $(TMP)/v4l_hg_whitespace > \
+ $(TMP)/v4l_hg_commit.msg
+ $(EDITOR) $(TMP)/v4l_hg_commit.msg
+ grep -v '^#' $(TMP)/v4l_hg_commit.msg | hg qrefresh -g -l -
+
pull update v4l-update::
@echo "Pulling changes from master repository $(REPO_PULL)"
-hg pull -u $(REPO_PULL)
diff --git a/v4l/scripts/prep_commit_msg.pl b/v4l/scripts/prep_commit_msg.pl
index f4047c6ba..819009c57 100755
--- a/v4l/scripts/prep_commit_msg.pl
+++ b/v4l/scripts/prep_commit_msg.pl
@@ -1,5 +1,10 @@
#!/usr/bin/perl
+my $diff = 'diff';
+if ($ARGV[0] eq '-q') {
+ $diff = 'qdiff';
+ shift;
+}
my $autopatch = shift;
# Get Hg username from environment
@@ -45,13 +50,25 @@ if ($user eq "") {
}
print "# Added/removed/changed files:\n";
-system "hg diff | diffstat -p1 -c";
+system "hg $diff | diffstat -p1 -c";
if (-s $autopatch) {
print "#\n# Note, a problem with your patch was detected! These changes were made\n";
print "# automatically: $autopatch\n";
system "diffstat -p0 -c $autopatch";
print "#\n# Please review these changes and see if they belong in your patch or not.\n";
}
+if ($diff eq 'qdiff') {
+ # Use existing mq patch logfile?
+ open IN, "hg qheader |";
+ my @header = <IN>;
+ close IN;
+ if ($#header > 0) {
+ # Use existing header
+ print @header;
+ exit;
+ }
+ # No header, use pre-made log message below
+}
print <<"EOF";
#
# For better log display, please keep a blank line after subject, after from,