[PATCH 2 of 2] remotefilelog: prevent this extension from loading on Windows

Augie Fackler raf at durin42.com
Wed Nov 28 13:59:19 EST 2018



> On Nov 27, 2018, at 22:46, Matt Harbison <mharbison72 at gmail.com> wrote:
> 
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1543376352 18000
> #      Tue Nov 27 22:39:12 2018 -0500
> # Node ID aac9ae9f512f53a907dc799d2d6050931001e6e1
> # Parent  c743bb1c19513a61925ce4663d33323aea7016cc
> remotefilelog: prevent this extension from loading on Windows

Hm, I have *vivid* memories of speaking up earlier, but I must not have sent it to the list. Fail on my part. Anyway: I *know* remotefilelog works on Windows. I'll probably tackle getting the tests to pass since they don't, but I'd appreciate it if we could leave RFL working there even if we can't test it.

> See 0800d9e6e216.
> 
> This doesn't actually abort.  Rather, it prints a stacktrace, says the extension
> failed to setup, and then runs the command.  Probably good enough for something
> marked "highly experimental", and hopefully somebody can figure out how to fix
> what doesn't work.

That'd be one thing if you did this *after* the monkeypatches, but instead this is before the monkeypatches, so you've *definitely* made the situation worse on Windows - things worked before this patch, and now most of the uisetup won't happen so you won't be able to invoke a remotefilelog clone.

> There actually is code and comments indicating workarounds for quirks on
> Windows.  But some of it is puzzling- for example, shallowutil.unlinkfile()
> handles unlinking read only files, but so does win32.unlink().  So I'm not sure
> why the former exists.

That's because it works on Windows. As for the weird shallowutil.unlinkfile, that's probably someone having been sloppy and/or wanting to avoid a dependency for some reason lost to history.

> 
> diff --git a/hgext/remotefilelog/__init__.py b/hgext/remotefilelog/__init__.py
> --- a/hgext/remotefilelog/__init__.py
> +++ b/hgext/remotefilelog/__init__.py
> @@ -257,6 +257,9 @@ def uisetup(ui):
>     """Wraps user facing Mercurial commands to swap them out with shallow
>     versions.
>     """
> +    if pycompat.iswindows:
> +        raise error.Abort(_("remotefilelog is not supported on Windows"))
> +
>     hg.wirepeersetupfuncs.append(fileserverclient.peersetup)
> 
>     entry = extensions.wrapcommand(commands.table, 'clone', cloneshallow)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list