mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
windows: grp module not supported
On windows the grp module is not present, so we need to avoid importing it. This means the shared group feature of remotefilelog is not supported on windows.
This commit is contained in:
parent
a1a32e5f37
commit
abf6481106
@ -1,9 +1,12 @@
|
|||||||
import errno, grp, os, shutil, time
|
import errno, os, shutil, stat, time
|
||||||
import shallowutil
|
import shallowutil
|
||||||
from mercurial import util
|
from mercurial import error, util
|
||||||
from mercurial.i18n import _
|
from mercurial.i18n import _
|
||||||
from mercurial.node import bin, hex
|
from mercurial.node import bin, hex
|
||||||
|
|
||||||
|
if os.name != 'nt':
|
||||||
|
import grp
|
||||||
|
|
||||||
class basestore(object):
|
class basestore(object):
|
||||||
def __init__(self, repo, path, reponame, shared=False):
|
def __init__(self, repo, path, reponame, shared=False):
|
||||||
"""Creates a remotefilelog store object for the given repo name.
|
"""Creates a remotefilelog store object for the given repo name.
|
||||||
@ -40,6 +43,9 @@ class basestore(object):
|
|||||||
|
|
||||||
groupname = self.ui.config("remotefilelog", "cachegroup")
|
groupname = self.ui.config("remotefilelog", "cachegroup")
|
||||||
if groupname:
|
if groupname:
|
||||||
|
if os.name == 'nt':
|
||||||
|
raise error.Abort(_('cachegroup option not'
|
||||||
|
' supported on Windows'))
|
||||||
gid = grp.getgrnam(groupname).gr_gid
|
gid = grp.getgrnam(groupname).gr_gid
|
||||||
if gid:
|
if gid:
|
||||||
os.chown(path, os.getuid(), gid)
|
os.chown(path, os.getuid(), gid)
|
||||||
|
@ -9,13 +9,16 @@ from mercurial.i18n import _
|
|||||||
from mercurial.node import hex, bin
|
from mercurial.node import hex, bin
|
||||||
from mercurial import util, sshpeer, hg, error, util, wireproto, node, httppeer
|
from mercurial import util, sshpeer, hg, error, util, wireproto, node, httppeer
|
||||||
from mercurial import scmutil
|
from mercurial import scmutil
|
||||||
import os, socket, lz4, time, grp, io, struct
|
import os, socket, lz4, time, io, struct
|
||||||
import errno
|
import errno
|
||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
import constants, datapack, historypack, shallowutil
|
import constants, datapack, historypack, shallowutil
|
||||||
from shallowutil import readexactly, readunpack
|
from shallowutil import readexactly, readunpack
|
||||||
|
|
||||||
|
if os.name != 'nt':
|
||||||
|
import grp
|
||||||
|
|
||||||
# Statistics for debugging
|
# Statistics for debugging
|
||||||
fetchcost = 0
|
fetchcost = 0
|
||||||
fetches = 0
|
fetches = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user