From 73480875596fc17625c910f133b015bf514ac725 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 28 Jan 2006 14:13:12 -0200 Subject: Several fixes for using with mercurial From: Mauro Carvalho Chehab cvs commands replaced to hg created a new script to help commiting Signed-off-by: Mauro Carvalho Chehab --- Makefile | 17 +++++++++++-- v4l/ChangeLog | 12 +++++++++ v4l/Makefile | 13 +++++++--- v4l/scripts/bttv.pl | 0 v4l/scripts/buildpatch | 0 v4l/scripts/cardlist | 0 v4l/scripts/cx88.pl | 0 v4l/scripts/em28xx.pl | 0 v4l/scripts/gentree.pl | 0 v4l/scripts/hwdata.pl | 0 v4l/scripts/insmod.sh | 0 v4l/scripts/make_kern_diff.sh | 0 v4l/scripts/makelinks.sh | 0 v4l/scripts/merge-pvrusb2.sh | 0 v4l/scripts/modules.sh | 0 v4l/scripts/prep_commit_msg.pl | 41 +++++++++++++++++++++++++++++++ v4l/scripts/prepare-ChangeLog.pl | 25 +++++++++++-------- v4l/scripts/release.sh | 0 v4l/scripts/saa7134.pl | 0 v4l/scripts/strip-trailing-whitespaces.sh | 0 v4l/scripts/tuner.pl | 0 v4l/scripts/update | 0 22 files changed, 92 insertions(+), 16 deletions(-) mode change 100644 => 100755 v4l/scripts/bttv.pl mode change 100644 => 100755 v4l/scripts/buildpatch mode change 100644 => 100755 v4l/scripts/cardlist mode change 100644 => 100755 v4l/scripts/cx88.pl mode change 100644 => 100755 v4l/scripts/em28xx.pl mode change 100644 => 100755 v4l/scripts/gentree.pl mode change 100644 => 100755 v4l/scripts/hwdata.pl mode change 100644 => 100755 v4l/scripts/insmod.sh mode change 100644 => 100755 v4l/scripts/make_kern_diff.sh mode change 100644 => 100755 v4l/scripts/makelinks.sh mode change 100644 => 100755 v4l/scripts/merge-pvrusb2.sh mode change 100644 => 100755 v4l/scripts/modules.sh create mode 100755 v4l/scripts/prep_commit_msg.pl mode change 100644 => 100755 v4l/scripts/prepare-ChangeLog.pl mode change 100644 => 100755 v4l/scripts/release.sh mode change 100644 => 100755 v4l/scripts/saa7134.pl mode change 100644 => 100755 v4l/scripts/strip-trailing-whitespaces.sh mode change 100644 => 100755 v4l/scripts/tuner.pl mode change 100644 => 100755 v4l/scripts/update diff --git a/Makefile b/Makefile index 150ad99be..62b909525 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ BUILD_DIR := $(shell pwd)/v4l +REPO_PULL := http://linuxtv.org/hg/v4l-dvb +REPO_PUSH := ssh://linuxtv.org/hg/v4l-dvb ifeq ($(EDITOR),) ifeq ($(VISUAL),) @@ -16,9 +18,20 @@ install: %:: $(MAKE) -C $(BUILD_DIR) $(MAKECMDGOALS) -changelog:: whitespace +commit cvscommit hgcommit:: + v4l/scripts/prep_commit_msg.pl v4l/ChangeLog >/tmp/v4l_hg_commit.msg + $(EDITOR) /tmp/v4l_hg_commit.msg + grep -v ^# /tmp/v4l_hg_commit.msg | hg commit -l - + +pull update v4l-update:: + -hg pull $(REPO_PULL) + hg checkout + +push:: commit + -hg push $(REPO_PUSH) + +change changes changelog:: whitespace update cd $(BUILD_DIR); scripts/cardlist; cd .. - cvs update v4l/scripts/prepare-ChangeLog.pl $(EDITOR) v4l/ChangeLog diff --git a/v4l/ChangeLog b/v4l/ChangeLog index 36a474d4f..44c20a446 100644 --- a/v4l/ChangeLog +++ b/v4l/ChangeLog @@ -1,3 +1,15 @@ +2006-01-28 15:46 mchehab + + * Makefile: + * v4l/Makefile: + * v4l/scripts/prep_commit_msg.pl: + * v4l/scripts/prepare-ChangeLog.pl: + - Several fixes for using with mercurial + cvs commands replaced to hg + created a new script to help commiting + + Signed-off-by: Mauro Carvalho Chehab + 2005-01-25 13:45 mrechberger * v4l_experimental/xc3028/setup.sh diff --git a/v4l/Makefile b/v4l/Makefile index 4c1bbe96c..003140d78 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -315,6 +315,8 @@ v4l_modules := $(shell /sbin/lsmod|cut -d' ' -f1 ) $(patsubst %.ko,%,$(inst-m)) LC_ALL = POSIX export LC_ALL +all:: default + default:: links .version $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules @@ -478,11 +480,14 @@ distclean:: clean change changes changelog:: make -C .. changelog -cvscommit cvs commit:: - cd ..; cvs commit +update:: + make -C .. update + +commit cvscommit hgcommit:: + make -C .. commit -update v4l-update:: - cd ..; cvs update +push:: + make -C .. push insmod load:: scripts/insmod.sh load diff --git a/v4l/scripts/bttv.pl b/v4l/scripts/bttv.pl old mode 100644 new mode 100755 diff --git a/v4l/scripts/buildpatch b/v4l/scripts/buildpatch old mode 100644 new mode 100755 diff --git a/v4l/scripts/cardlist b/v4l/scripts/cardlist old mode 100644 new mode 100755 diff --git a/v4l/scripts/cx88.pl b/v4l/scripts/cx88.pl old mode 100644 new mode 100755 diff --git a/v4l/scripts/em28xx.pl b/v4l/scripts/em28xx.pl old mode 100644 new mode 100755 diff --git a/v4l/scripts/gentree.pl b/v4l/scripts/gentree.pl old mode 100644 new mode 100755 diff --git a/v4l/scripts/hwdata.pl b/v4l/scripts/hwdata.pl old mode 100644 new mode 100755 diff --git a/v4l/scripts/insmod.sh b/v4l/scripts/insmod.sh old mode 100644 new mode 100755 diff --git a/v4l/scripts/make_kern_diff.sh b/v4l/scripts/make_kern_diff.sh old mode 100644 new mode 100755 diff --git a/v4l/scripts/makelinks.sh b/v4l/scripts/makelinks.sh old mode 100644 new mode 100755 diff --git a/v4l/scripts/merge-pvrusb2.sh b/v4l/scripts/merge-pvrusb2.sh old mode 100644 new mode 100755 diff --git a/v4l/scripts/modules.sh b/v4l/scripts/modules.sh old mode 100644 new mode 100755 diff --git a/v4l/scripts/prep_commit_msg.pl b/v4l/scripts/prep_commit_msg.pl new file mode 100755 index 000000000..239fb6092 --- /dev/null +++ b/v4l/scripts/prep_commit_msg.pl @@ -0,0 +1,41 @@ +#!/usr/bin/perl + +$f=shift; +open IN,"<$f"; +my $n=2; +my $from=""; +my $first=""; +my $changed=""; +$out=""; +while () { + if (m/^[0-9]/) { + $n--; + next; + } + if ($n>0) { + s/[\t -]*//; + if (m/^\* (.*):/) { + $changed="#\t$1\n$changed"; + } else { + if ($first eq "") { + if ($_ eq "\n") { + next; + } + $first="$_"; + next; + } + if ($from eq "") { + if (m/Signed-off-by:/) { + $from = $_; + $from =~ s/Signed-off-by/From/; + $first="$first\n#\n# Then From line\n$from\n"; + } + } + $out="$out$_"; + } + } +} +printf "#Added/removed/changed files:\n%s" . + "# First line should be the subject, without Subject:\n%s" . + "# Then a detailed description followed by Signed-off-by: fields:\n%s", + $changed,$first,$out; diff --git a/v4l/scripts/prepare-ChangeLog.pl b/v4l/scripts/prepare-ChangeLog.pl old mode 100644 new mode 100755 index 087e94bf2..c3b253246 --- a/v4l/scripts/prepare-ChangeLog.pl +++ b/v4l/scripts/prepare-ChangeLog.pl @@ -2,7 +2,7 @@ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 2 -*- # Perl script to create a ChangeLog entry with names of files -# and functions from a cvs diff. +# and functions from a hg diff. # # Darin Adler , started 20 April 2000 # Java support added by Maciej Stachowiak @@ -13,6 +13,10 @@ # CHANVE_LOG Env variables now are mandatory. # Updated at 15 January 2005 # +# Mauro Carvalho Chehab : modified to +# work with Mercurial +# Updated at 29 August 2005 +# # (Someone put a license in here, like maybe GPL.) # # TODO: @@ -77,26 +81,27 @@ if (!defined $login) # Read the old change log file. # It's less efficient to read the whole thing into memory than it would be # to read it while we prepend to it later, but I like doing this part first. -print STDERR " Updating ChangeLog from cvs repository.\n"; -open ERRORS, "cvs update v4l/ChangeLog |" or die "The cvs update of ChangeLog failed: $OS_ERROR.\n"; -print STDERR " $ARG" while ; -close ERRORS; +#print STDERR " Updating ChangeLog from hg repository.\n"; +#open ERRORS, "hg update ChangeLog |" or die "The hg update of ChangeLog failed: $OS_ERROR.\n"; +#print STDERR " $ARG" while ; +#close ERRORS; open OLD_CHANGE_LOG, "v4l/ChangeLog" or die "Could not open ChangeLog file: $OS_ERROR.\n"; my @old_change_log = ; close OLD_CHANGE_LOG; # For each file, build a list of modified lines. # Use line numbers from the "after" side of each diff. -print STDERR " Running cvs diff to find changes.\n"; +print STDERR " Running hg diff to find changes.\n"; my %changed_line_ranges; my $file; -open DIFF, "cvs -fq diff -N |" or die "The cvs diff failed: $OS_ERROR.\n"; +open DIFF, "hg diff |" or die "The hg diff failed: $OS_ERROR.\n"; while () { - $file = $1 if /^Index: (\S+)$/; +#diff -r faaf1cf8404a video4linux/scripts/prepare-ChangeLog.pl +# and (/^\d+(,\d+)?[acd](\d+)(,(\d+))?/ or /^Binary files/) ) + $file = $1 if /^diff -r .* (\S+)$/; if (defined $file - and $file ne "v4l/ChangeLog" - and (/^\d+(,\d+)?[acd](\d+)(,(\d+))?/ or /^Binary files/) ) + and $file ne "v4l/ChangeLog" ) { push @{$changed_line_ranges{$file}}, [ $2, $4 || $2 ]; } diff --git a/v4l/scripts/release.sh b/v4l/scripts/release.sh old mode 100644 new mode 100755 diff --git a/v4l/scripts/saa7134.pl b/v4l/scripts/saa7134.pl old mode 100644 new mode 100755 diff --git a/v4l/scripts/strip-trailing-whitespaces.sh b/v4l/scripts/strip-trailing-whitespaces.sh old mode 100644 new mode 100755 diff --git a/v4l/scripts/tuner.pl b/v4l/scripts/tuner.pl old mode 100644 new mode 100755 diff --git a/v4l/scripts/update b/v4l/scripts/update old mode 100644 new mode 100755 -- cgit v1.2.3