[PATCH] Add script to rewrite manifest to workaround lack of parent deltas

Benoit Boissinot benoit.boissinot at ens-lyon.org
Mon Aug 24 11:03:05 CDT 2009


On Fri, Aug 21, 2009 at 06:18:02PM -0400, Greg Ward wrote:
> # HG changeset patch
> # User Greg Ward <greg-hg at gerg.ca>
> # Date 1233047576 0
> # Node ID 4b03b395c5923319c1d9986ab47e6e3d99bfc6f8
> # Parent  b47fa638bfc7d6e5185f49113a6c418fbe6cf0b3
> Add script to rewrite manifest to workaround lack of parent deltas.

I'm playing with it, just two comments as I actually used it.
> +
> +def main():
> +
> +    # Unbuffer stdout for nice progress output.
> +    sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
> +    write = sys.stdout.write
> +
> +    # Open the local repository.
> +    ui = ui_.ui()
> +    repo = hg.repository(ui)
> +
> +    indexfn = repo.join('store/00manifest.i')

use sjoin and drop the store reference, otherwise it doesn't work with
older repos.
> +
> +    (tmpfd, tmpindexfn) = tempfile.mkstemp(dir=repo.join('store'),

ditto: repo.sjoin('')
> +                                           prefix='00manifest.',
> +                                           suffix='.i')

> +    lock = repo.lock(wait=False)
> +    tr = transaction.transaction(sys.stderr.write,
> +                                 open,
> +                                 repo.join('store/journal'))

ditto

regards,

Benoit

-- 
:wq


More information about the Mercurial-devel mailing list