Mercurial can do this with the record extension.
It'll prompt you for each file and each diff hunk. For example:
% hg record
diff --git a/prelim.tex b/prelim.tex
2 hunks, 4 lines changed
examine changes to 'prelim.tex'? [Ynsfdaq?]
@@ -12,7 +12,7 @@
setmonofont[Scale=0.88]{Consolas}
% missing from xunicode.sty
DeclareUTFcomposite[UTFencname]{x00ED}{'}{i}
-else
+else foo
usepackage[pdftex]{graphicx}
fi
record this change to 'prelim.tex'? [Ynsfdaq?]
@@ -1281,3 +1281,5 @@
%% Local variables:
%% mode: latex
%% End:
+
+foo
No newline at end of file
record this change to 'prelim.tex'? [Ynsfdaq?] n
Waiting for Emacs...
After the commit, the remaining diff will be left behind:
% hg di
diff --git a/prelim.tex b/prelim.tex
--- a/prelim.tex
+++ b/prelim.tex
@@ -1281,3 +1281,5 @@
%% Local variables:
%% mode: latex
%% End:
+
+foo
No newline at end of file
Alternatively, you may find it easier to use MQ (Mercurial Queues) to separate the individual changes in your repository into patches. There is a MQ variant of record (qrecord), too.
Update: Also try the crecord extension, which provides a curses interface to hunk/line selection.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…