[issue2062] qrefresh -e aborts and loses its commit message if the patch queue is modified elsewhere
Brodie Rao
bugs at mercurial.selenic.com
Wed Feb 24 15:45:29 UTC 2010
New submission from Brodie Rao <dackze at gmail.com>:
Admittedly, this isn't something I run into often, but every once in a while I'll
decide to qref -e a patch and add a commit message. Now, if I've written an essay
in my editor and forget about it for a while, qpopping and qpushing in the same
repository later on, when I save and exit my editor, qref will abort and my lengthy
and thoughtful commit message is gone forever.
Henrik suggested qrefresh could lock the patch queue while it's running. Here's a
test for that behavior:
diff --git a/tests/test-mq-qrefresh-replace-log-message b/tests/test-mq-qrefresh-
replace-log-message
--- a/tests/test-mq-qrefresh-replace-log-message
+++ b/tests/test-mq-qrefresh-replace-log-message
@@ -53,3 +53,12 @@ echo =======================
printf "Should display 'Fifth commit message\\\n This is the 5th log message'\n"
hg log -l1 -v | sed -n '/description/,$p'
echo
+
+# Testing qrefresh -e on a patch being popped elsewhere
+echo > sleepy <<EOF
+#!/bin/sh
+sleep 3
+EOF
+chmod +x sleepy
+HGEDITOR=./sleepy hg qrefresh -e
+hg qpop || echo "qpop failed as expected"
diff --git a/tests/test-mq-qrefresh-replace-log-message.out b/tests/test-mq-
qrefresh-replace-log-message.out
--- a/tests/test-mq-qrefresh-replace-log-message.out
+++ b/tests/test-mq-qrefresh-replace-log-message.out
@@ -30,4 +30,4 @@ description:
Fifth commit message
-
+qpop failed as expected
I also noticed that qrefresh doesn't use any of the .hg/last-message.txt machinery
from hg commit, and it seems like hg commit would also lose its message if it
aborted, but I haven't looked into it deeply.
----------
messages: 11878
nosy: brodie
priority: bug
status: unread
title: qrefresh -e aborts and loses its commit message if the patch queue is modified elsewhere
topic: 1.4.3, mq, surprise
____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2062>
____________________________________________________
More information about the Mercurial-devel
mailing list