No subject


Tue Sep 18 20:14:02 UTC 2007


From: Weijun Max Wang <Weijun.Wang at sun.com>

# Run this script in an empty directory
hg init

# Create a hook that rejects any file with BAD inside it
echo '[hooks]' >> .hg/hgrc
echo 'pretxncommit = .hg/pre' >> .hg/hgrc

# The hook script
cat > .hg/pre << EOF
#! /bin/bash

FILES=\$(hg log -r \$HG_NODE: --template '{files} ')
for FILE in \$FILES; do
    grep BAD \$FILE && { echo "Do not use BAD"; exit 1; }
done
exit 0
EOF

chmod a+x .hg/pre
echo GOOD > 1
hg commit -A -m Initial

hg qinit
hg qnew a

# Create a bad file
echo BAD > 2
hg add

# The next qrefresh should fail because of the bad file
hg qrefresh

# Fix it
echo GOOD > 2

# The next qrefresh should succeed
hg qrefresh

# However, it fails because the first qrefresh fails into an
# illegal state. The second part of the "rollback+commit" actions
# are rejected, but the first part remains.
#

----------
assignedto: alexis
messages: 5283
nosy: alexis
priority: bug
status: unread
title: qrefresh: mq gets confused if commit fails
topic: mq

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue987>
____________________________________________________



More information about the Mercurial-devel mailing list