pushing error: empty or missing revlog for Mac/Contrib/PyIDE-src/Scripts/ Hold option to open a script

higery shoulderhigher at gmail.com
Tue Jun 14 03:51:54 CDT 2011


> No. It is much simpler. Explorer of Windows Vista and Windows 7 remove
> leading spaces of files when they copy files. It has nothing to do with
> Windows XP.
>
> If you have a repo that was created with Mercurial < 1.7 it may have
> files with leading spaces inside .hg (provided someone committed a file
> with a leading spaces in the past into the repo, which normally just
> happens by error, so people usually rename and commit, but the old file
> with the leading space remains inside .hg since it's already part of the
> history).
>
> If you copy the repo root directory (with all its contents) to for
> example a USB flash stick using Explorer of Windows Vista or Windows 7,
> explorer corrupts the repo by modifying the filenames because explorer
> of Vista or Windows 7 strips leading spaces from filenames (explorer of
> Windows XP doesn't do that).
>
> If the repository format is Mercurial >= 1.7, no corruption can happen
> any more because the leading spaces inside .hg/store are encoded (and
> thus protected from silly Vista/Windows 7 Explorer).
>
> Again, upgrading Mercurial / TortoiseHg won't upgrade repository formats
> of preexisting repositories (those need to be converted using 'hg clone
> --pull' if you need the new repo format -- which is the case here).
>
> > Office computer installed TortoiseHg 1.0 and Mercurial 1.5, which I just
> > used to get my current repo by cloning from a remote server, and when I
> > tried to verify it today, all goes well. It means that though I have
> > used the latest version of TortoiseHg and Mercurial on my home computer,
>
> That's good. So you have a perfectly fine repo in format < 1.7 at your
> office.
>
> Sounds like a good moment to make a backup (just don't use Vista or
> Windows 7 Explorer to make a backup of a pre-1.7 repo :-).
>

All that you should do is installing the latest Mercurial or TortoiseHg
> version at your office computer and convert the repo on your office
> computer to the latest format using
>
>    hg clone --pull repo newrepo
>


Yes, you are so right! When using copying method to make a backup locally,
the repo will be corrupted. I have also tried to use 'hg clone --pull
oldrepo newrepo'  command to backup, and then verify the newrepo, it goes
well.  Thank you very much, you have a much wider knowledge to know the real
reason of occured problems, even though it's cross-platform and tough, and
your detail explanation has helped me a lot.


>
> > but the repo has been corrupted when copying from office. In other
> > words, Win7(32bit version) would not do auto-stripping though filename
> > contains leading spaces,
>
> Stupid Explorer of Windows 7 *does* strip leading spaces of filenames.
> So it will (or already has) corrupted your home repo.
>
> > but when copying repo to WindowsXP, leading
> > spaces will be stripped, thus repo corruption problem occurs.
>
> It doesn't need a Windows XP to have stripped filenames. In fact,
> Explorer of Windows XP doesn't strip leading spaces, so it is better
> than Explorer of Vista or Windows 7.
>
> > So according to Adrian's important suggestion and my today's finding, I
> > think there maybe two solutions for me:
>
> > 1) convert the repo on my home computer with --pull cloning
> > But the repo has already been currpted, so I'm not sure the files which
> > has been stripped will be recoveried after conversion.
> > If it's ok, then good. If not, I think I can hack the fncache file.
>
> Conversion will fail since the repo at your home is already corrupt.
>
> If you try to manually repair the repo: you'd need to rectify the
> filename inside .hg/store (which would be a task for an expert, since
> you need to understand the filename encoding. I'll refrain from making
> detailed suggestions here, as I think that's just too delicate).
>
> I wouldn't try doing that. Start from your office repo again.
>

As you said, it's so difficult for me and all the previous attempts failed.
But good thing is that I have reduced the errors to only one - copying not
stripped files in good repo, then adding path items in fncache file to let
hg can find them.

The only error is related to a file, which not only has leading spaces, but
also contains encoded characters in its filename. I got some helpful
information from page
http://mercurial.selenic.com/wiki/fncacheRepoFormatand knew that files
containing Windows reserved names are encoded. Then how
should I add corresponding file path to let hg find such kind of file.

With regard to my current problem, this file is
"D:\cpython-packaging-gsoc\.hg\store\data\_mac\_contrib\_py_i_d_e-src\_scripts\
_hold option to open a script~c2~8a.i". I have tried the following three
kinds of path in fncache file, but both failed.
1) data/Mac/Contrib/PyIDE-src/Scripts/  Hold option to open a script聤.i
It's just contained in the output msg, and the inside messy code appear
because of different encoding on different platforms.
2) data/Mac/Contrib/PyIDE-src/Scripts/  Hold option to open a script~c2~8a.i
I think '~c2~8a' as a path in fncache is much different from in a filename.
'~c2~8a' will be re-encoded or transfered when hg reading fncache, so it
also failed.
3 ) data/Mac/Contrib/PyIDE-src/Scripts/  Hold option to open a scriptŠ.i
I tried to transfer the encoded string '~c2~8a' to its corresponding ascii
code, but it failed either.

So, Adrian, do you have some good advice about how to set the path towards
such kind of files with encoded filename?


> > 2) import my changesets to office computer and try to push
> > Because repo on office computer is not corrupted, so it's ok to import
> > these new changesets, the only troublesome thing is remaking changes and
> > recommitting them.
>
> That sounds slightly better.
>

I'm pushing now, : )  thank you


Best regards,
higery
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20110614/46ca7084/attachment.htm>


More information about the Mercurial-devel mailing list