##// END OF EJS Templates
merge: allow merging going backwards...
merge: allow merging going backwards New behavior is generally superior and more correct, except possibly with regards to missing files. hg up . is now effectively a no-op, which is probably the desired behavior for people expecting to move to tip, but may surprise people who were expecting deleted files to reappear. case 1: update to . a-w -> a-w classic: ancestor a missing recreated right? rmed recreated WRONG added forgotten WRONG changed preserved RIGHT conflicted can't happen backward merge: ancestor a (NO EFFECT) missing missing wrong? rm'ed rm'ed RIGHT added preserved RIGHT changed preserved RIGHT conflicted can't happen case 2: update to ancestor of . a-b-w -> b-w \ a classic: ancestor a missing recreated right? rmed recreated wrong? added forgotten wrong? changed preserved RIGHT conflicted preserved wrong? backwards merge: ancestor b missing missing or conflict right? rm'ed missing or conflict right? changed preserved RIGHT conflicted merge RIGHT added preserved right?

File last commit:

r8742:a964ab62 default
r8742:a964ab62 default
Show More
test-custom-filters
60 lines | 1.1 KiB | text/plain | TextLexer
#!/bin/sh
hg init
cat > .hg/hgrc <<EOF
[extensions]
prefixfilter = prefix.py
[encode]
*.txt = stripprefix: Copyright 2046, The Masters
[decode]
*.txt = insertprefix: Copyright 2046, The Masters
EOF
cat > prefix.py <<EOF
from mercurial import util
def stripprefix(s, cmd, filename, **kwargs):
header = '%s\n' % cmd
if s[:len(header)] != header:
raise util.Abort('missing header "%s" in %s' % (cmd, filename))
return s[len(header):]
def insertprefix(s, cmd):
return '%s\n%s' % (cmd, s)
def reposetup(ui, repo):
repo.adddatafilter('stripprefix:', stripprefix)
repo.adddatafilter('insertprefix:', insertprefix)
EOF
cat > .hgignore <<EOF
.hgignore
prefix.py
prefix.pyc
EOF
cat > stuff.txt <<EOF
Copyright 2046, The Masters
Some stuff to ponder very carefully.
EOF
hg add stuff.txt
hg ci -m stuff
echo '% Repository data:'
hg cat stuff.txt
echo '% Fresh checkout:'
rm stuff.txt
hg up -C
cat stuff.txt
echo >> stuff.txt <<EOF
Very very carefully.
EOF
hg stat
cat > morestuff.txt <<EOF
Unauthorized material subject to destruction.
EOF
echo '% Problem encoding:'
hg add morestuff.txt
hg ci -m morestuff
hg stat