本文整理汇总了Python中dulwich.object_store.DiskObjectStore.init方法的典型用法代码示例。如果您正苦于以下问题:Python DiskObjectStore.init方法的具体用法?Python DiskObjectStore.init怎么用?Python DiskObjectStore.init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dulwich.object_store.DiskObjectStore
的用法示例。
在下文中一共展示了DiskObjectStore.init方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _init_maybe_bare
# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import init [as 别名]
def _init_maybe_bare(cls, path, bare):
for d in BASE_DIRECTORIES:
os.mkdir(os.path.join(path, *d))
DiskObjectStore.init(os.path.join(path, OBJECTDIR))
ret = cls(path)
ret.refs.set_symbolic_ref(b"HEAD", b"refs/heads/master")
ret._init_files(bare)
return ret
示例2: _init_maybe_bare
# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import init [as 别名]
def _init_maybe_bare(cls, path, bare):
for d in BASE_DIRECTORIES:
os.mkdir(os.path.join(path, *d))
DiskObjectStore.init(os.path.join(path, OBJECTDIR))
ret = cls(path)
ret.refs.set_symbolic_ref(b'HEAD', DEFAULT_REF)
ret._init_files(bare)
return ret
示例3: create
# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import init [as 别名]
def create(worktree: Path, store: Path):
List.wrap(BASE_DIRECTORIES)\
.smap(store.joinpath) %\
__.mkdir(parents=True, exist_ok=True)
DiskObjectStore.init(str(store / OBJECTDIR))
repo = DulwichRepo(store, worktree)
repo.refs.set_symbolic_ref(b'HEAD', _master_ref.encode())
return repo
示例4: _init_maybe_bare
# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import init [as 别名]
def _init_maybe_bare(cls, path, bare):
if not isinstance(path, bytes):
path_bytes = path.encode(sys.getfilesystemencoding())
else:
path_bytes = path
for d in BASE_DIRECTORIES:
os.mkdir(os.path.join(path_bytes, *d))
DiskObjectStore.init(os.path.join(path_bytes, OBJECTDIR))
ret = cls(path)
ret.refs.set_symbolic_ref(b'HEAD', b"refs/heads/master")
ret._init_files(bare)
return ret
示例5: init_bare
# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import init [as 别名]
def init_bare(cls, path, mkdir=True):
for d in BASE_DIRECTORIES:
os.mkdir(os.path.join(path, *d))
DiskObjectStore.init(os.path.join(path, OBJECTDIR))
ret = cls(path)
ret.refs.set_symbolic_ref("HEAD", "refs/heads/master")
ret._put_named_file('description', "Unnamed repository")
ret._put_named_file('config', """[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
""")
ret._put_named_file(os.path.join('info', 'excludes'), '')
return ret
示例6: setUp
# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import init [as 别名]
def setUp(self):
TestCase.setUp(self)
self.store_dir = tempfile.mkdtemp()
if not isinstance(self.store_dir, bytes):
self.store_dir = self.store_dir.encode(sys.getfilesystemencoding())
self.addCleanup(shutil.rmtree, self.store_dir)
self.store = DiskObjectStore.init(self.store_dir)
示例7: setUp
# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import init [as 别名]
def setUp(self):
TestCase.setUp(self)
self.store_dir = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.store_dir)
self.store = DiskObjectStore.init(self.store_dir)
示例8: setUp
# 需要导入模块: from dulwich.object_store import DiskObjectStore [as 别名]
# 或者: from dulwich.object_store.DiskObjectStore import init [as 别名]
def setUp(self):
TestCase.setUp(self)
self.store_dir = tempfile.mkdtemp()
self.store = DiskObjectStore.init(self.store_dir)