[issue535] darcs record; darcs send; darcs unrecord --last=1" fails in (partial) ghc head repo

Claus Reinke claus.reinke at talk21.com
Tue Sep 18 14:57:39 EDT 2007


>    darcs record; darcs send; darcs unrecord --last=1
>
>i have no idea whyever darcs would need to look beyond the last
>patch if that is all i want to unrecord, so why is partial/complete
>repo even an issue here? looks like a bug to me.
>
>and is there a workaround that could help me..?

i was lucky to have a recent backup of the repo but, without
wanting to put down darcs (i really like how easy it is to set up
and get started, or how i can put up a repo on simple http, so i
was -initially, at least- delighted to see it more or less scale up
to repos the size of ghc's), this doesn't look good (at all!), and
gives me a very insecure feeling when using darcs:

i shouldn't need to depend on backups, the revision control
system's main purpose is to keep my old versions safe and
accessible, and undoing the last record seems to be a very
basic feature of such a system.

having made a backup of _darcs before my next record/send,
i could check what darcs was doing and found what i expected:

    $ diff -qr _darcs ../_darcs/
    Only in ../_darcs/: .inventory.swp
    Files _darcs/inventory and ../_darcs/inventory differ
    Only in ../_darcs/patches: 20070918015956-969c0-7366c0b86461d3320d02e68a97981e9a7dbc3165.gz
    Only in ../_darcs/prefs: author
    Files _darcs/pristine/compiler/basicTypes/RdrName.lhs and
../_darcs/pristine/compiler/basicTypes/RdrName.lhs differ
    Files _darcs/pristine/compiler/ghci/InteractiveUI.hs and
../_darcs/pristine/compiler/ghci/InteractiveUI.hs differ
    Files _darcs/pristine/compiler/main/DynFlags.hs and ../_darcs/pristine/compiler/main/DynFlags.hs
differ
    Files _darcs/pristine/compiler/main/GHC.hs and ../_darcs/pristine/compiler/main/GHC.hs differ
    Files _darcs/pristine/docs/users_guide/ghci.xml and ../_darcs/pristine/docs/users_guide/ghci.xml
differ

the only differences were the extra patch summary at the end of
_darcs/inventory, the added patch file, and the patches recorded
into _darcs/pristine.

i still can see no reason why 'darcs unrecord --last=1' would
have to look beyond that: just unapply the last patch, to restore
_darcs/pristine, then remove the patch and patch summary.

to confirm, something like this appears to do what i expected
to achieve using 'darcs unrecord --last=1':

    darcs diff -u --last=1 >../diff-last.log
    (..remove unrecorded hunks from diff-last.log ..)
    patch -u -R -p1 -d _darcs/pristine <../diff-last.log

followed by removing the patch from _darcs/patches and
the summary from _darcs/inventory (the patch being the
newest, or the one refered to in the summary).

at least, the repo checks out as consistent, and 'darcs
whatsnew' lists the changes that used to be recorded
in the patch i removed.

are there reasons that 'darcs unrecord --last=1' doesn't
do this, or is it a bug? if it is not a bug, could a darcs
command be added to automate this essential function?

thanks,
claus




More information about the Cvs-ghc mailing list