# HG changeset patch # User Matt Harbison # Date 2015-06-12 20:11:42 # Node ID 2b2108c35bfca8d553602b8e3f765f36b2c97a41 # Parent 521c1a3139c983f20367dcc1cb19a1f08fef1fab largefiles: restore the original converter class after lfconvert --to-normal Not sure how much this really matters, but much of the largefiles code that monkey-patches like this restores things when it finishes. diff --git a/hgext/largefiles/lfcommands.py b/hgext/largefiles/lfcommands.py --- a/hgext/largefiles/lfcommands.py +++ b/hgext/largefiles/lfcommands.py @@ -159,8 +159,13 @@ def lfconvert(ui, src, dest, *pats, **op if missing != 0: raise util.Abort(_("all largefiles must be present locally")) + orig = convcmd.converter convcmd.converter = converter - convcmd.convert(ui, src, dest) + + try: + convcmd.convert(ui, src, dest) + finally: + convcmd.converter = orig success = True finally: if tolfile: