view tests/test-diff-change @ 7654:816b708f23af

store all heads of a branch in the branch cache All heads of branches will be stored in a new cache file 'branchheads.cache' within the .hg directory. The old 'branch.cache' file from older versions will be ignored. The new cache contents are formatted line-by-line as '{node} {branchtag}\n'. This is the same as the previous format. Now, every head is recorded in an oldest -> tipmost order. The localrepo.branchheads function is reworked to use the data from the cache.
author John Mulligan <phlogistonjohn@asynchrono.us>
date Wed, 14 Jan 2009 21:47:38 -0500
parents 9c6ae2e09e11
children 89c2b78faec4
line wrap: on
line source

#!/bin/sh -e

# test of hg diff --change

set -e

ec() {
	echo "invoking $@:"
	"$@"
}

hg init a
cd a

echo "first" > file.txt
hg add file.txt
hg commit -m 'first commit' # 0

echo "second" > file.txt
hg commit -m 'second commit' # 1

echo "third" > file.txt
hg commit -m 'third commit' # 2

ec hg diff --nodates --change 1

echo

#rev=$(hg log -r 1 --template '{node|short}')
rev=e9b286083166
ec hg diff --nodates --change "$rev"

##
# Testing diff -c when merge

for i in 1 2 3 4 5 6 7 8 9 10; do
    echo $i >> file.txt
done
hg commit -m "lots of text" # 3

sed -i -e 's,^2$,x,' file.txt
hg commit -m "changed 2 to x" # 4

hg up -r 3 > /dev/null 2>&1 # updated, merged, removed, unresolved
sed -i -e 's,^8$,y,' file.txt
hg commit -m "change 8 to y" > /dev/null 2>&1 # 5 # created new head

hg up -C -r 4 > /dev/null 2>&1 # updated, merged, removed, unresolved
hg merge -r 5 > /dev/null 2>&1 # updated, merged, removed, unresolved
hg commit -m "merging 8 to y" # 6

echo
ec hg diff --nodates --change 6 # must be similar to hg diff --nodates --change 5

#echo
#hg log

echo
echo "EOF"

# vim: set ts=4 sw=4 et: