#require serve 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 $ hg import -q --bypass - < # HG changeset patch > # User test > # Date 0 0 > b > > diff --git a/a b/a > old mode 100644 > new mode 100755 > diff --git a/b b/b > deleted file mode 100644 > --- a/b > +++ /dev/null > @@ -1,1 +0,0 @@ > -b > EOF 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 $ get-with-headers.py localhost:$HGPORT 'rev/0' 200 Script output follows test: 0cd96de13884

changeset 0:0cd96de13884 draft

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 wrap: on
line diff
  --- /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
  --- /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
raw revision $ 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 $ hg log --template "{file_mods}\n{file_dels}\n" -r tip a b $ hg parents --template "{node|short}\n" -r tip 0cd96de13884 $ hg parents --template "{node|short}\n" -r tip b 0cd96de13884 $ get-with-headers.py localhost:$HGPORT 'diff/tip/b' 200 Script output follows test: b diff

diff b @ 1:559edbd9ed20 draft default tip

b
author test
date Thu, 01 Jan 1970 00:00:00 +0000
parents 0cd96de13884
children
line wrap: on
line diff
  --- a/b	Thu Jan 01 00:00:00 1970 +0000
  +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
  @@ -1,1 +0,0 @@
  -b
set up hgweb with git diffs + noprefix $ killdaemons.py $ hg serve --config 'diff.git=1' --config 'diff.noprefix=1' -p $HGPORT -d \ > --pid-file=hg.pid -A access.log -E errors.log $ cat hg.pid >> $DAEMON_PIDS patch header and diffstat $ get-with-headers.py localhost:$HGPORT 'rev/0' \ > | egrep 'files changed|---|\+\+\+' 2 files changed, 2 insertions(+), 0 deletions(-) --- /dev/null +++ a --- /dev/null +++ b set up hgweb with git diffs $ 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 $ get-with-headers.py localhost:$HGPORT 'rev/0' 200 Script output follows test: 0cd96de13884

changeset 0:0cd96de13884 draft

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 wrap: on
line diff
  new file mode 100644
  --- /dev/null
  +++ b/a
  @@ -0,0 +1,1 @@
  +a
  new file mode 100644
  --- /dev/null
  +++ b/b
  @@ -0,0 +1,1 @@
  +b
revision $ 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 modified file $ hg log --template "{file_mods}\n{file_dels}\n" -r tip a b $ hg parents --template "{node|short}\n" -r tip 0cd96de13884 $ hg parents --template "{node|short}\n" -r tip a 0cd96de13884 $ get-with-headers.py localhost:$HGPORT 'diff/tip/a' 200 Script output follows test: a diff

diff a @ 1:559edbd9ed20 draft default tip

b
author test
date Thu, 01 Jan 1970 00:00:00 +0000
parents 0cd96de13884
children
line wrap: on
line diff
  old mode 100644
  new mode 100755
comparison new file $ hg parents --template "{rev}:{node|short}\n" -r 0 $ hg log --template "{rev}:{node|short}\n" -r 0 0:0cd96de13884 $ get-with-headers.py localhost:$HGPORT 'comparison/0/a' 200 Script output follows test: a comparison

comparison a @ 0:0cd96de13884 draft

a
author test
date Thu, 01 Jan 1970 00:00:00 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0cd96de13884
1 a
comparison existing file $ hg up 1 files updated, 0 files merged, 1 files removed, 0 files unresolved $ echo a >> a $ hg ci -mc $ hg parents --template "{rev}:{node|short}\n" -r tip 1:559edbd9ed20 $ hg log --template "{rev}:{node|short}\n" -r tip 2:d73db4d812ff $ get-with-headers.py localhost:$HGPORT 'comparison/tip/a' 200 Script output follows test: a comparison

comparison a @ 2:d73db4d812ff draft default tip

c
author test
date Thu, 01 Jan 1970 00:00:00 +0000
parents 0cd96de13884
children
comparison
equal deleted inserted replaced
1:559edbd9ed20 2:d73db4d812ff
1 a 1 a
2 a
comparison removed file $ hg rm a $ hg ci -md $ hg parents --template "{rev}:{node|short}\n" -r tip 2:d73db4d812ff $ hg log --template "{rev}:{node|short}\n" -r tip 3:20e80271eb7a $ get-with-headers.py localhost:$HGPORT 'comparison/tip/a' 200 Script output follows test: a comparison

comparison a @ 3:20e80271eb7a draft default tip

d
author test
date Thu, 01 Jan 1970 00:00:00 +0000
parents d73db4d812ff
children
comparison
equal deleted inserted replaced
2:d73db4d812ff 3:20e80271eb7a
1 a
2 a
comparison not-modified file $ echo e > e $ hg add e $ hg ci -m e $ echo f > f $ hg add f $ hg ci -m f $ hg tip --template "{rev}:{node|short}\n" 5:41d9fc4a6ae1 $ hg diff -c tip e $ hg parents --template "{rev}:{node|short}\n" -r tip 4:402bea3b0976 $ hg parents --template "{rev}:{node|short}\n" -r tip e 4:402bea3b0976 $ get-with-headers.py localhost:$HGPORT 'comparison/tip/e' 200 Script output follows test: e comparison

comparison e @ 5:41d9fc4a6ae1 draft default tip

f
author test
date Thu, 01 Jan 1970 00:00:00 +0000
parents 402bea3b0976
children
comparison
equal deleted inserted replaced
4:402bea3b0976 5:41d9fc4a6ae1
$ 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 new changesets 0cd96de13884 updating to branch default 2 files updated, 0 files merged, 0 files removed, 0 files unresolved $ cd test1 $ hg import -q --bypass --exact http://localhost:$HGPORT/rev/1 raw revision with diff block numbers $ 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 $ 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 $ 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 $ cd ..