I had the following plan:
- pause dependent patches (those that depend on the patch I want to change or throw away).
- somehow forget the patch for re-order and save it in another place (maybe in another "darcs branch", ie repo copy) and return the changes in the working directory so that the working directory is clean.
- then cancel the suspended patches to the state where I want to insert the patched patch. (Resolution of all conflicts that arise.)
- apply the saved patch (possibly pulling it from the saved branch), that is, a copy of the darcs replica that I saved in step 2).
- unsuspend all remaining patches. (Resolution of all conflicts that arise.)
Here are some notes on how this went on.
1. suspend dependent patches
, ,
"" ( ),
(
"" ,
):
darcs suspend -h <MINIMAL-DEPENDENT-HASH>
( ).
, ,
( ).
2.
-, , :
darcs diff -h 61fbb4aeac9e69cf30d232eda274c18194d7a8d9 --diff-command='emacs -f ediff-directories-with-ancestor-command %1 %2'
( , diff
, , , Emacs ediff
, .)
,
. , , :
.
darcs unrec -h 61fbb4aeac9e69cf30d232eda274c18194d7a8d9
(, ) ediff .
darcs diff --diff-command='emacs -f ediff-directories-with-ancestor-command %1 %2'
(
). :
darcs rec -m 'examples/Process.hs: code cleanup (present as a sequence of actions and error handling)'
darcs rec -m 'examples/Process.hs: print the C program (from the AST) after the check (as gcc -E does)'
()
darcs obliterate -o -O
, darcs apply ( ).
:
()
:
~/TOOLS/prog/language-c $ darcs clone . ../language-c_printAST
darcs failed: Can't clone a repository with a rebase in progress
~/TOOLS/prog/language-c $
, ( ,
):
~/TOOLS/prog/language-c $ cp -a ../language-c ../language-c_printAST
~/TOOLS/prog/language-c $ darcs pull ../language-c_printAST
darcs failed: Incompatibility with repository /home/imz/TOOLS/prog/language-c_printAST:
Cannot transfer patches from a repository where a rebase is in progress
~/TOOLS/prog/language-c $ cd ../language-c_printAST/
~/TOOLS/prog/language-c_printAST $ darcs rebase obliterate
<...>
Really obliterate all undecided patches? y
Rebase finished!
~/TOOLS/prog/language-c_printAST $ cd ../language-c
~/TOOLS/prog/language-c $ darcs pull ../language-c_printAST
HINT: if you want to change the default remote repository to
/home/imz/TOOLS/prog/language-c_printAST,
quit now and issue the same command with the
No remote patches to pull in!
~/TOOLS/prog/language-c $
, , .
( ) :
darcs obliterate
3. Unsuspend ,
,
- .
Unsuspend , . ( ,
unsuspend.)
,
:
darcs rebase unsuspend
darcs amend
4.
darcs pull ../../language-c_printAST
darcs amend
5. Unsuspend .
( , .)
darcs rebase unsuspend
darcs amend
( - , ,
.
, .)