$ "$TESTDIR/hghave" serve execbit || exit 80 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 +x a $ hg rm b $ 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, 01 Jan 1970 00:00:00 +0000
parents
children 559edbd9ed20
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/b' 200 Script output follows test: b diff

test

diff b @ 1:559edbd9ed20

b
author test
date Thu, 01 Jan 1970 00:00:00 +0000
parents 0cd96de13884
children
line diff
     1.1 --- a/b	Thu Jan 01 00:00:00 1970 +0000
       1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
       1.3 @@ -1,1 +0,0 @@
       1.4 -b
  
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, 01 Jan 1970 00:00:00 +0000
parents
children 559edbd9ed20
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:559edbd9ed20

b
author test
date Thu, 01 Jan 1970 00:00:00 +0000
parents
children
line diff
     1.1 old mode 100644
       1.2 new mode 100755
  
$ 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 raw revision with diff block numbers $ "$TESTDIR/killdaemons.py" $ cat < .hg/hgrc > [web] > templates = rawdiff > EOF $ mkdir rawdiff $ cat < rawdiff/map > mimetype = 'text/plain; charset={encoding}' > changeset = '{diff}' > difflineplus = '{line}' > difflineminus = '{line}' > difflineat = '{line}' > diffline = '{line}' > filenodelink = '' > filenolink = '' > fileline = '{line}' > diffblock = 'Block: {blockno}\n{lines}\n' > EOF $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0' 200 Script output follows Block: 1 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 Block: 2 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 $ "$TESTDIR/killdaemons.py" $ rm .hg/hgrc rawdiff/map $ rmdir rawdiff $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS errors $ cat ../test/errors.log