23.03.2019, 04:44, "Luke Diamand" <l...@diamand.org>:
> On Fri, 22 Mar 2019 at 19:54, Mazo, Andrey <am...@checkvideo.com> wrote:
>>  Our Perforce server experienced some kind of database corruption a few 
>> years ago.
>>  While the file data and revision history are mostly intact,
>>  some metadata for several changesets got lost.
>
> I think it's not unheard of for P4 databases to end up being corrupt,
> as in your case.
>
> It looks like the RCS files get updated, but the database files (i.e.
> the metadata) do not, after which you have a bit of a problem.

Yeah, that's exactly what happened! :/

> So I guess this change could be quite useful, but it really needs some
> documentation and tests to support it - git-p4 is already complicated
> enough!

Great, thanks for positive feedback.
Let me start working on these.
Luckily, the actual git-p4 changes are fairly straightforward.

> Your example script should probably use the same magic that the git-p4
> script uses to pick the path to Python.
Oh, you mean "#!/usr/bin/env python"?
Sure!

Actually, I also have a smarter "example script", which reconstructs `p4 
describe` output from `p4 files` and `p4 change` without manual intervention.
It's still short enough to be posted inside commit message, but would it make 
sense to put it under contrib/ and reference from the docs?

> And perhaps come up with a nicer name than "damaged" - as you say, it
> could also be used for other purposes.
Does anything from the list below sound reasonable?
 1. git-p4.loadChangelistInfo
 2. git-p4.changelistInfoOverride
 3. git-p4.cachedChangelistInfo

>> For simplicity, it's one pickled file per changelist.
(talking to myself)
I realized `p4 -G describe` produces a marshalled output, not pickled one.
Don't know why I decided to use pickle instead of marshal back when I wrote it.
I'll switch to marshal for serialization/deserialization in the next reroll.
It'll be easier for testing as well, since `p4 -G describe` output could be fed 
directly to damagedChangelists machinery without the need to convert it from 
marshal to pickle.

Thank you,
Andrey

Reply via email to