Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 31594:4a1bf30f5438
util: use util.getfstype
author | Jun Wu <quark@fb.com> |
---|---|
date | Thu, 23 Mar 2017 12:01:18 -0700 |
parents | ae02cc1f5369 |
children | 32f09ead059b |
comparison
equal
deleted
inserted
replaced
31593:ae02cc1f5369 | 31594:4a1bf30f5438 |
---|---|
1084 oldstat = checkambig and filestat(dest) | 1084 oldstat = checkambig and filestat(dest) |
1085 unlink(dest) | 1085 unlink(dest) |
1086 if hardlink: | 1086 if hardlink: |
1087 # Hardlinks are problematic on CIFS (issue4546), do not allow hardlinks | 1087 # Hardlinks are problematic on CIFS (issue4546), do not allow hardlinks |
1088 # unless we are confident that dest is on a whitelisted filesystem. | 1088 # unless we are confident that dest is on a whitelisted filesystem. |
1089 destdir = os.path.dirname(dest) | 1089 fstype = getfstype(os.path.dirname(dest)) |
1090 fstype = getattr(osutil, 'getfstype', lambda x: None)(destdir) | |
1091 if fstype not in _hardlinkfswhitelist: | 1090 if fstype not in _hardlinkfswhitelist: |
1092 hardlink = False | 1091 hardlink = False |
1093 if hardlink: | 1092 if hardlink: |
1094 try: | 1093 try: |
1095 oslink(src, dest) | 1094 oslink(src, dest) |