On Apr 21, 2008, at 7:12 AM, William Stein wrote:

> On Thu, Mar 27, 2008 at 4:49 PM, Robert Bradshaw
> <[EMAIL PROTECTED]> wrote:
>>
>>  I've looked into this some more and it looks like we can completely
>>  reconstruct a repository from the export of all its keywords. The
>>  trick is to use the --exact keyword when importing. This forces  
>> it to
>>  apply the given patch to the correct parent (sometimes creating a  
>> new
>>  head) and will also correctly import merge patches (removing heads).
>>  Some scripts to do this are up at
>>
>>  http://sage.math.washington.edu/home/robertwb/hg/
>>
>>  I've successfully exported and re-created simple repositories (with
>>  branching) with these scripts, and it works great and preserves all
>>  the history. The only issue is that I can't seem to get it to work
>>  with any repositories older than a certain date. I think the  
>> issue is
>>  that mercurial changed the way nodeid's are calculated (and I keep
>>  getting an error "abort: patch is damaged or loses information"  
>> which
>>  is thrown when the newly computed nodeid does not match the one in
>>  the patch (command.py:1632 in 0.9.5)). Matt Mackall, any suggestions
>>  on how to cleanly get around this/get the old node-id numbers  
>> instead
>
> Robert,
>
> Did you ever get a response to this question?  Any updates on this?
>
> William

Yes, they changed the way they do hashing, so if you commit the same  
sequence of patches you will get different nodeids than you would  
have in the past. This is how parents are identified, so will result  
in missing parent errors.

I have a hacked version of mercurial that will keep a correspondance  
between old and new hashes that allows you to recreate a repository  
from the list of patches alone (this is how I rebased Cython,  
exporting the patches, running them through a diff to change the  
paths, and recreating the repo from those). One drawback is that the  
nodeid's will be different so the repositories aren't compatible  
anymore. (I also know how to change it the other way, so the  
"computed" hash will just be the old one if available.)

If people are interested, I could try and release a less hackish patch.

- Robert


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to