##// END OF EJS Templates
clone: print "updating working directory" status message...
clone: print "updating working directory" status message With this change, "hg clone" looks like this: % hg clone http://example.com/repo/big big requesting all changes adding changesets adding manifests adding file changes added XXX changesets with XXX changes to XXX files updating working directory XXX files updated, XXX files merged, XXX files removed, XXX files unresolved So the user sees % hg clone http://example.com/repo/big big requesting all changes adding changesets adding manifests adding file changes added XXX changesets with XXX changes to XXX files updating working directory while Mercurial is writing to disk to populate the working directory With this change, "hg clone" looks like this: % hg clone big big-work updating working directory XXX files updated, XXX files merged, XXX files removed, XXX files unresolved

File last commit:

r6328:991f7518 default
r6338:0750f111 default
Show More
test-keyword
298 lines | 5.2 KiB | text/plain | TextLexer
Christian Ebert
keyword: add test
r5816 #!/bin/sh
cat <<EOF >> $HGRCPATH
[extensions]
hgext.keyword =
Christian Ebert
keyword: add very simple mq test
r5894 hgext.mq =
Christian Ebert
keyword: add test for patch.diff monkey
r6116 hgext.notify =
Christian Ebert
keyword: add test
r5816 [keyword]
* =
b = ignore
[hooks]
commit=
commit.test=cp a hooktest
EOF
echo % help
hg help keyword
echo % hg kwdemo
hg --quiet kwdemo --default \
| sed -e 's![^ ][^ ]*demo.txt,v!/TMP/demo.txt,v!' \
-e 's/,v [a-z0-9][a-z0-9]* /,v xxxxxxxxxxxx /' \
-e '/[$]Revision/ s/: [a-z0-9][a-z0-9]* /: xxxxxxxxxxxx /' \
-e 's! 20[0-9][0-9]/[01][0-9]/[0-3][0-9] [0-2][0-9]:[0-6][0-9]:[0-6][0-9]! 2000/00/00 00:00:00!'
hg --quiet kwdemo "Branch = {branches}"
Christian Ebert
keyword: safeguards against erroneous behaviour or aborts...
r6051 hg init Test-bndl
cd Test-bndl
Christian Ebert
keyword: add test
r5816
echo % kwshrink should exit silently in empty/invalid repo
hg kwshrink
Patrick Mezard
test-keyword: make it run under Windows...
r6061 # Symlinks cannot be created on Windows. The bundle was made with:
#
# hg init t
# cd t
# echo a > a
# ln -s a sym
# hg add sym
# hg ci -m addsym -u mercurial
# hg bundle --base null ../test-keyword.hg
#
hg pull -u "$TESTDIR/test-keyword.hg" \
| sed 's/pulling from.*test-keyword.hg/pulling from test-keyword.hg/'
Christian Ebert
keyword: add test
r5816 echo 'expand $Id$' > a
echo 'do not process $Id:' >> a
echo 'xxx $' >> a
echo 'ignore $Id$' > b
echo % cat
Patrick Mezard
test-keyword: make it run under Windows...
r6061 cat a b
Christian Ebert
keyword: add test
r5816
echo % addremove
hg addremove
echo % status
hg status
echo % default keyword expansion including commit hook
echo % interrupted commit should not change state or run commit hook
Thomas Arendsen Hein
Solaris compatibility fixes for test-keyword:...
r5855 hg --debug commit
Christian Ebert
keyword: add test
r5816 echo % status
hg status
echo % commit
hg --debug commit -mabsym -d '0 0' -u 'User Name <user@example.com>'
echo % status
hg status
echo % identify
Alexis S. L. Carvalho
keyword: remove "identify" and "remove" from nokwcommands...
r6157 hg debugrebuildstate
Christian Ebert
keyword: add test
r5816 hg --quiet identify
echo % cat
Patrick Mezard
test-keyword: make it run under Windows...
r6061 cat a b
Christian Ebert
keyword: add test
r5816 echo % hg cat
hg cat sym a b
echo
echo % diff a hooktest
diff a hooktest
echo % removing commit hook from config
sed -e '/\[hooks\]/,$ d' $HGRCPATH > $HGRCPATH.nohook
mv $HGRCPATH.nohook $HGRCPATH
rm hooktest
Christian Ebert
keyword: safeguards against erroneous behaviour or aborts...
r6051 echo % bundle
hg bundle --base null ../kw.hg
cd ..
hg init Test
cd Test
Christian Ebert
keyword: add test for patch.diff monkey
r6116 echo % notify on pull to check whether keywords stay as is in email
echo % ie. if patch.diff wrapper acts as it should
cat <<EOF >> $HGRCPATH
[hooks]
incoming.notify = python:hgext.notify.hook
[notify]
sources = pull
diffstat = False
[reposubs]
* = Test
EOF
Christian Ebert
keyword: safeguards against erroneous behaviour or aborts...
r6051 echo % pull from bundle
Christian Ebert
keyword: add test for patch.diff monkey
r6116 hg pull -u ../kw.hg 2>&1 | sed -e '/^Date:/,/^diffs (/ d'
echo % remove notify config
sed -e '/\[hooks\]/,$ d' $HGRCPATH > $HGRCPATH.nonotify
mv $HGRCPATH.nonotify $HGRCPATH
Christian Ebert
keyword: safeguards against erroneous behaviour or aborts...
r6051
Christian Ebert
keyword: add test
r5816 echo % touch
touch a b
echo % status
hg status
rm sym a b
echo % update
hg update
echo % cat
Patrick Mezard
test-keyword: make it run under Windows...
r6061 cat a b
Christian Ebert
keyword: add test
r5816
Christian Ebert
keyword: test that expansion is done filewise...
r5856 echo % check whether expansion is filewise
echo '$Id$' > c
echo 'tests for different changenodes' >> c
echo % commit c
hg commit -A -mcndiff -d '1 0' -u 'User Name <user@example.com>'
echo % force expansion
hg -v kwexpand
echo % compare changenodes in a c
cat a c
Christian Ebert
keyword: add very simple mq test
r5894
Christian Ebert
keyword: safeguards against erroneous behaviour or aborts...
r6051 echo % qinit -c
hg qinit -c
Christian Ebert
keyword: add very simple mq test
r5894 echo % qimport
hg qimport -r tip -n mqtest.diff
Christian Ebert
keyword: safeguards against erroneous behaviour or aborts...
r6051 echo % qcommit
hg qcommit -mqtest
Christian Ebert
keyword: add very simple mq test
r5894 echo % keywords should not be expanded in patch
cat .hg/patches/mqtest.diff
echo % qpop
hg qpop
echo % qgoto - should imply qpush
hg qgoto mqtest.diff
echo % cat
cat c
echo % qpop and move on
hg qpop
Christian Ebert
keyword: test that expansion is done filewise...
r5856
Christian Ebert
keyword: add test
r5816 echo % copy
hg cp a c
echo % kwfiles added
hg kwfiles
echo % commit
hg --debug commit -ma2c -d '1 0' -u 'User Name <user@example.com>'
echo % cat a c
cat a c
Matt Mackall
tests: remove some unnecessary sleeps
r6328 echo % touch copied c
Christian Ebert
keyword: add test
r5816 touch c
echo % status
hg status
echo % kwfiles
hg kwfiles
echo % diff --rev
Patrick Mezard
test-keyword: make it run under Windows...
r6061 hg diff --rev 1 | grep -v 'b/c'
Christian Ebert
keyword: add test
r5816
echo % rollback
hg rollback
echo % status
hg status
echo % update -C
hg update --clean
echo % custom keyword expansion
echo % try with kwdemo
hg --quiet kwdemo "Xinfo = {author}: {desc}"
cat <<EOF >>$HGRCPATH
[keywordmaps]
Id = {file} {node|short} {date|rfc822date} {author|user}
Xinfo = {author}: {desc}
EOF
echo % cat
Patrick Mezard
test-keyword: make it run under Windows...
r6061 cat a b
Christian Ebert
keyword: add test
r5816 echo % hg cat
hg cat sym a b
echo
echo '$Xinfo$' >> a
cat <<EOF >> log
firstline
secondline
EOF
echo % interrupted commit should not change state
Thomas Arendsen Hein
Solaris compatibility fixes for test-keyword:...
r5855 hg commit
Christian Ebert
keyword: add test
r5816 echo % status
hg status
echo % commit
hg --debug commit -l log -d '2 0' -u 'User Name <user@example.com>'
rm log
echo % status
hg status
echo % cat
Patrick Mezard
test-keyword: make it run under Windows...
r6061 cat a b
Christian Ebert
keyword: add test
r5816 echo % hg cat
hg cat sym a b
echo
echo % remove
Alexis S. L. Carvalho
keyword: remove "identify" and "remove" from nokwcommands...
r6157 hg debugrebuildstate
Christian Ebert
keyword: add test
r5816 hg remove a
hg --debug commit -m rma
echo % status
hg status
echo % rollback
hg rollback
echo % status
hg status
echo % revert a
hg revert --no-backup --rev tip a
echo % cat a
cat a
echo % clone to test incoming
cd ..
Patrick Mezard
test-keyword: make it run under Windows...
r6061 hg clone -r1 Test Test-a
Christian Ebert
keyword: add test
r5816 cd Test-a
cat <<EOF >> .hg/hgrc
[paths]
default = ../Test
EOF
echo % incoming
# remove path to temp dir
hg incoming | sed -e 's/^\(comparing with \).*\(test-keyword.*\)/\1\2/'
Will Maier
Don't use the -i option with sed...
r5839 sed -e 's/Id.*/& rejecttest/' a > a.new
mv a.new a
Christian Ebert
keyword: add test
r5816 echo % commit rejecttest
hg --debug commit -m'rejects?' -d '3 0' -u 'User Name <user@example.com>'
echo % export
hg export -o ../rejecttest.diff tip
cd ../Test
echo % import
hg import ../rejecttest.diff
echo % cat
Patrick Mezard
test-keyword: make it run under Windows...
r6061 cat a b
Christian Ebert
keyword: add test
r5816 echo
echo % rollback
hg rollback
echo % clean update
hg update --clean
echo % kwexpand/kwshrink on selected files
mkdir x
echo % copy a x/a
hg copy a x/a
echo % kwexpand a
hg --verbose kwexpand a
echo % kwexpand x/a should abort
hg --verbose kwexpand x/a
cd x
hg --debug commit -m xa -d '3 0' -u 'User Name <user@example.com>'
echo % cat a
cat a
echo % kwshrink a inside directory x
hg --verbose kwshrink a
echo % cat a
cat a
Thomas Arendsen Hein
Solaris compatibility fixes for test-keyword:...
r5855 cd ..
Christian Ebert
keyword: add test
r5816
echo % kwexpand nonexistent
Patrick Mezard
test-keyword: make it run under Windows...
r6061 hg kwexpand nonexistent 2>&1 | sed 's/nonexistent:.*/nonexistent:/'
Christian Ebert
keyword: add test
r5816
echo % switch off expansion
echo % kwshrink with unknown file u
cp a u
hg --verbose kwshrink
echo % cat
Patrick Mezard
test-keyword: make it run under Windows...
r6061 cat a b
Christian Ebert
keyword: add test
r5816 echo % hg cat
hg cat sym a b
echo
rm $HGRCPATH
echo % cat
Patrick Mezard
test-keyword: make it run under Windows...
r6061 cat a b
Christian Ebert
keyword: add test
r5816 echo % hg cat
hg cat sym a b
echo