[PATCH 1 of 1] convert: implement two hooks in builtin cvsps

Patrick Mézard pmezard at gmail.com
Wed Dec 16 13:50:18 CST 2009


Le 16/12/09 03:56, Frank Kingswood a écrit :
> # HG changeset patch
> # User Frank Kingswood <frank at kingswood-consulting.co.uk>
> # Date 1260873443 0
> # Node ID 322ed4dbd60bce9d7288b80785bfda3976290055
> # Parent  25919ebaba017e4395709a8c6d96f2b7370f6d02
> convert: implement two hooks in builtin cvsps

Great.

Do you mind me merging cvshooks.py into the test script? It avoids PYTHONPATH manipulations:


diff --git a/tests/cvshooks.py b/tests/cvshooks.py
deleted file mode 100644
--- a/tests/cvshooks.py
+++ /dev/null
@@ -1,7 +0,0 @@
-
-def cvslog(ui,repo,hooktype,log):
-    print "%s hook: %d entries"%(hooktype,len(log))
-
-def cvschangesets(ui,repo,hooktype,changesets):
-    print "%s hook: %d changesets"%(hooktype,len(changesets))
-
diff --git a/tests/test-convert-cvs b/tests/test-convert-cvs
--- a/tests/test-convert-cvs
+++ b/tests/test-convert-cvs
@@ -2,8 +2,6 @@
 
 "$TESTDIR/hghave" cvs || exit 80
 
-PYTHONPATH=$TESTDIR:$PYTHONPATH
-
 cvscall()
 {
     cvs -f "$@"
@@ -18,9 +16,18 @@
 echo "convert = " >> $HGRCPATH
 echo "graphlog = " >> $HGRCPATH
 
+cat > cvshooks.py <<EOF
+def cvslog(ui,repo,hooktype,log):
+    print "%s hook: %d entries"%(hooktype,len(log))
+
+def cvschangesets(ui,repo,hooktype,changesets):
+    print "%s hook: %d changesets"%(hooktype,len(changesets))
+EOF
+hookpath=`pwd`
+
 echo "[hooks]" >> $HGRCPATH
-echo "cvslog=python:cvshooks.cvslog" >> $HGRCPATH
-echo "cvschangesets=python:cvshooks.cvschangesets" >> $HGRCPATH
+echo "cvslog=python:$hookpath/cvshooks.py:cvslog" >> $HGRCPATH
+echo "cvschangesets=python:$hookpath/cvshooks.py:cvschangesets" >> $HGRCPATH
 
 echo % create cvs repository
 mkdir cvsrepo


--
Patrick Mézard


More information about the Mercurial-devel mailing list