[darcs-users] "inconsistent" repositories [was buggy darcs_cgi in 0.9.14.15pre-1 ?]

David Roundy droundy at abridgegame.org
Sun Dec 7 19:18:24 UTC 2003


On Sun, Dec 07, 2003 at 10:27:33PM +1100, Tim Barbour wrote:
> David Roundy writes:
>  > Yeah, you need to run convert-repo after the upgrade.  If whatsnew showed
>  > no changes before the conversion, it will afterwards show that every file
>  > has had a line added.  You will want to either record or revert this.  It
>  > should only be recorded once per project.  After the conversion, the
>  > repository can still be used by 0.9.14 remotely, but a given repository's
>  > working directory should probably best be used by only either 0.9.14 or
>  > 0.9.15pre and later, since they don't have the same understanding of
>  > trailing newlines.
> 
> Unfortunately I was busy recording patches in one of my projects, using
> 0.9.15pre, without having run convert-repo. When I try to convert (a copy
> of) it I get the output appended below - note the Unapplicable patch!
> near the end.
> 
> Does this mean I have wrecked the repository ?

No, not irretreivably.  I hadn't thought of this.  The problem is that your
repository was in an inconsistent state while you were recording, after
switching to 0.9.15pre and before running convert-repo, which made it
possible to record inconsistent patches.

There are two levels of recovery.  To simply recover your repository as it
was when you switched to 0.9.15 is easy, especially if you tagged
recently (but before switching to 0.9.15pre).  You just run

darcs get -t 'latest tag' repo
cd repo_0
convert-repo # Just to be sure...
darcs record # to record all the line endings...
darcs pull ../repo

and pull all the tags up to where you switched to 0.9.15.  You can also
pull any more recent patches that don't change the ends of any files.

To get inconsistent patches which change file endings (and are thus
affected by the trailing newline change), the easiest way is perhaps to
edit the patch file manually.  In this case, the inconsistant (primitive)
patch is almost certainly the

hunk ./README 10
+Note that klunkxx NEEDS EXPLICIT INITIALISATION before first use (and similar
+finalisation after last use). Failure to so will cause core dumps. Read the
+instructions in "klunkxx/doc/README.INITIALISATION". You have been warned!
+

and you should probably change this to

hunk ./README 9
+
+Note that klunkxx NEEDS EXPLICIT INITIALISATION before first use (and similar
+finalisation after last use). Failure to so will cause core dumps. Read the
+instructions in "klunkxx/doc/README.INITIALISATION". You have been warned!

in a copy of the repo (you can ungzip the patch and then add the .gz back
to the filename so you can easily edit it).  Then you should be able to
pull the patch.

If there aren't many changes to existing files in your recently recorded
changes (I noticed that this patch only modified one file), you may want to
try just editing them by hand.

I will definitely want to make a big warning when I release 0.9.15...
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list