setting up repo $ hg init test $ cd test $ echo a > a $ echo b > b $ hg ci -Ama adding a adding b change permissions for git diffs $ chmod 755 a $ hg ci -Amb set up hgweb $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS revision $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0' 200 Script output follows test: 0cd96de13884

test

changeset 0:0cd96de13884

a
author test
date Thu Jan 01 00:00:00 1970 +0000
parents
children 78e4ebad7cdf
files a b
diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       1.2 +++ b/a	Thu Jan 01 00:00:00 1970 +0000
       1.3 @@ -0,0 +1,1 @@
       1.4 +a
  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       2.2 +++ b/b	Thu Jan 01 00:00:00 1970 +0000
       2.3 @@ -0,0 +1,1 @@
       2.4 +b
  
raw revision $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0' 200 Script output follows # HG changeset patch # User test # Date 0 0 # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e a diff -r 000000000000 -r 0cd96de13884 a --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/a Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +a diff -r 000000000000 -r 0cd96de13884 b --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/b Thu Jan 01 00:00:00 1970 +0000 @@ -0,0 +1,1 @@ +b diff removed file $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a' 200 Script output follows test: a diff

test

diff a @ 1:78e4ebad7cdf

b
author test
date Thu Jan 01 00:00:00 1970 +0000
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
       1.2 +++ b/a	Thu Jan 01 00:00:00 1970 +0000
       1.3 @@ -0,0 +1,1 @@
       1.4 +a
  
set up hgweb with git diffs $ "$TESTDIR/killdaemons.py" $ hg serve --config 'diff.git=1' -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS revision $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0' 200 Script output follows test: 0cd96de13884

test

changeset 0:0cd96de13884

a
author test
date Thu Jan 01 00:00:00 1970 +0000
parents
children 78e4ebad7cdf
files a b
diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
line diff
     1.1 new file mode 100644
       1.2 --- /dev/null
       1.3 +++ b/a
       1.4 @@ -0,0 +1,1 @@
       1.5 +a
  
     2.1 new file mode 100644
       2.2 --- /dev/null
       2.3 +++ b/b
       2.4 @@ -0,0 +1,1 @@
       2.5 +b
  
revision $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0' 200 Script output follows # HG changeset patch # User test # Date 0 0 # Node ID 0cd96de13884b090099512d4794ae87ad067ea8e a diff --git a/a b/a new file mode 100644 --- /dev/null +++ b/a @@ -0,0 +1,1 @@ +a diff --git a/b b/b new file mode 100644 --- /dev/null +++ b/b @@ -0,0 +1,1 @@ +b diff removed file $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a' 200 Script output follows test: a diff

test

diff a @ 1:78e4ebad7cdf

b
author test
date Thu Jan 01 00:00:00 1970 +0000
parents
children
line diff
     1.1 new file mode 100755
       1.2 --- /dev/null
       1.3 +++ b/a
       1.4 @@ -0,0 +1,1 @@
       1.5 +a
  
$ cd .. test import rev as raw-rev $ hg clone -r0 test test1 adding changesets adding manifests adding file changes added 1 changesets with 2 changes to 2 files updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd test1 $ hg import -q --exact http://localhost:$HGPORT/rev/1 errors $ cat ../test/errors.log