How to change the order of dependent changes in gifts?

In darcs, if I want to reorder the top (or just throw away) a patch that other patches depend on (i.e. change the same file)?

In git, I simply executed git rebase -i <UNTOUCHED-REVISION>and reordered or threw some changes; then git awkwardly tries to apply the old changes to the new version of the tree one by one and ask to resolve the conflicts that arise.

In darcs, I see no way to make it ignore dependencies between patches. If I obliterateor suspend(or unrecord) the patch that other fixes depend on, darcs refuses to do so. (Because he wants to behave in a smart way.)

+4
source share
1 answer

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 --set-default flag.
No remote patches to pull in!
~/TOOLS/prog/language-c $ 

, , .

( ) :

darcs obliterate

3. Unsuspend ,

, - .

Unsuspend , . ( , unsuspend.) , :

darcs rebase unsuspend
# resolve conflicts
darcs amend
# repeat for the remaining patches you want to have

4.

darcs pull ../../language-c_printAST
# resolve conflicts
darcs amend

5. Unsuspend .

( , .)

darcs rebase unsuspend
# resolve conflicts
darcs amend
# repeat for the remaining patches you want to have

( - , , . , .)

+4

Source: https://habr.com/ru/post/1621973/


All Articles