On Thu, Mar 02, 2017 at 10:12:51AM -0800, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <dur...@fb.com>
> # Date 1488478360 28800
> #      Thu Mar 02 10:12:40 2017 -0800
> # Node ID 32c17aa5fc546a112b355e734fb71b740172cf09
> # Parent  a8458fe51a9d155f1daeaffdcf503e674d4d4588
> util: add allowhardlinks module variable

Queued, thanks.

>
> To enable extensions to enable hardlinks for certain environments, let's move
> the 'if False' to be an 'if allowhardlinks' and let extensions modify the
> allowhardlinks variable.
>
> Tests on linux ext4 pass with it set to True and to False.
>
> diff --git a/mercurial/util.py b/mercurial/util.py
> --- a/mercurial/util.py
> +++ b/mercurial/util.py
> @@ -1056,6 +1056,11 @@ def checksignature(func):
>
>      return check
>
> +# Hardlinks are problematic on CIFS, do not allow hardlinks
> +# until we find a way to work around it cleanly (issue4546).
> +# This is a variable so extensions can opt-in to using them.
> +allowhardlinks = False
> +
>  def copyfile(src, dest, hardlink=False, copystat=False, checkambig=False):
>      '''copy a file, preserving mode and optionally other stat info like
>      atime/mtime
> @@ -1072,9 +1077,7 @@ def copyfile(src, dest, hardlink=False,
>          if checkambig:
>              oldstat = checkambig and filestat(dest)
>          unlink(dest)
> -    # hardlinks are problematic on CIFS, quietly ignore this flag
> -    # until we find a way to work around it cleanly (issue4546)
> -    if False and hardlink:
> +    if allowhardlinks and hardlink:
>          try:
>              oslink(src, dest)
>              return
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to