Rename to remotefilelog since shallowrepo is already taken

This commit is contained in:
Durham Goode 2013-06-21 10:14:29 -07:00
parent ff1e4bb8e7
commit f16a3a4134
9 changed files with 40 additions and 35 deletions

View File

@ -2,12 +2,10 @@ PYTHON=python
.PHONY: tests
PREFIX=/usr/local
help:
@echo 'Commonly used make targets:'
@echo ' local - build for inplace use'
@echo ' install - install program and man pages to PREFIX ($(PREFIX))'
@echo ' install - install program'
@echo ' clean - remove files created by other targets'
@echo ' (except installed files or dist source tarball)'
@ -17,7 +15,7 @@ local:
build_ext -i
install:
$(PYTHON) setup.py $(PURE) install --prefix="$(PREFIX)" --force
$(PYTHON) setup.py $(PURE) install --force
clean:
-$(PYTHON) setup.py clean --all # ignore errors from this command

View File

@ -22,9 +22,9 @@ import struct, zlib, errno, collections, time, os, pdb, socket, subprocess, lz4
import stat
shallowremote = False
localrepo.localrepository.supported.add('remotefilelog')
def uisetup(ui):
localrepo.localrepository.requirements.append('shallowrepo')
entry = extensions.wrapcommand(commands.table, 'clone', cloneshallow)
entry[1].append(('', 'shallow', None,
_("create a shallow clone which uses remote file history")))
@ -34,7 +34,7 @@ def uisetup(ui):
# Prevent 'hg manifest --all'
def _manifest(orig, ui, repo, *args, **opts):
if "shallowrepo" in repo.requirements and opts.get('all'):
if "remotefilelog" in repo.requirements and opts.get('all'):
raise util.Abort(_("--all is not supported in a shallow repo"))
return orig(ui, repo, *args, **opts)
@ -52,7 +52,7 @@ def cloneshallow(orig, ui, repo, *args, **opts):
self.__class__.__bases__ = (self.__class__.__bases__[0],
self.unfiltered().__class__)
requirements.add('shallowrepo')
requirements.add('remotefilelog')
# if the repo was filtered, we need to refilter since
# the class has changed
@ -70,7 +70,7 @@ def reposetup(ui, repo):
return
isserverenabled = ui.configbool('remotefilelog', 'server')
isshallowclient = "shallowrepo" in repo.requirements
isshallowclient = "remotefilelog" in repo.requirements
if isserverenabled and isshallowclient:
raise Exception("Cannot be both a server and shallow client.")
@ -115,7 +115,7 @@ def onetimesetup(ui):
def _walkstreamfiles(orig, repo):
if shallowremote:
# if we are shallow ourselves, stream our local commits
if "shallowrepo" in repo.requirements:
if "remotefilelog" in repo.requirements:
striplen = len(repo.store.path) + 1
readdir = repo.store.rawvfs.readdir
visit = [os.path.join(repo.store.path, 'data')]
@ -131,7 +131,7 @@ def onetimesetup(ui):
for x in repo.store.topfiles():
yield x
elif "shallowrepo" in repo.requirements:
elif "remotefilelog" in repo.requirements:
# don't allow cloning from a shallow repo to a full repo
# since it would require fetching every version of every
# file in order to create the revlogs.
@ -184,7 +184,7 @@ def onetimeclientsetup(ui):
def storewrapper(orig, requirements, path, vfstype):
s = orig(requirements, path, vfstype)
if 'shallowrepo' in requirements:
if 'remotefilelog' in requirements:
s = shallowstore.wrapstore(s)
return s
@ -192,7 +192,7 @@ def onetimeclientsetup(ui):
# prefetch files before update hook
def applyupdates(orig, repo, actions, wctx, mctx, actx, overwrite):
if 'shallowrepo' in repo.requirements:
if 'remotefilelog' in repo.requirements:
manifest = mctx.manifest()
files = []
for f, m, args, msg in [a for a in actions if a[1] == 'g']:
@ -218,7 +218,7 @@ def onetimeclientsetup(ui):
# prevent strip from considering filelogs
def _collectbrokencsets(orig, repo, files, striprev):
if 'shallowrepo' in repo.requirements:
if 'remotefilelog' in repo.requirements:
files = []
return orig(repo, files, striprev)
wrapfunction(repair, '_collectbrokencsets', _collectbrokencsets)
@ -252,14 +252,14 @@ def onetimeclientsetup(ui):
def filectx(orig, self, path, fileid=None, filelog=None):
if fileid is None:
fileid = self.filenode(path)
if 'shallowrepo' in self._repo.requirements:
if 'remotefilelog' in self._repo.requirements:
return remotefilectx.remotefilectx(self._repo, path,
fileid=fileid, changectx=self, filelog=filelog)
return orig(self, path, fileid=fileid, filelog=filelog)
wrapfunction(context.changectx, 'filectx', filectx)
def workingfilectx(orig, self, path, filelog=None):
if 'shallowrepo' in self._repo.requirements:
if 'remotefilelog' in self._repo.requirements:
return remotefilectx.remoteworkingfilectx(self._repo,
path, workingctx=self, filelog=filelog)
return orig(self, path, filelog=filelog)
@ -360,7 +360,7 @@ def getrenamedfn(repo, endrev=None):
return getrenamed
def walkfilerevs(orig, repo, match, follow, revs, fncache):
if not "shallowrepo" in repo.requirements:
if not "remotefilelog" in repo.requirements:
return orig(repo, match, follow, revs, fncache)
if not follow:
@ -398,7 +398,7 @@ def filelogrevset(orig, repo, subset, x):
a slower, more accurate result, use ``file()``.
"""
if not "shallowrepo" in repo.requirements:
if not "remotefilelog" in repo.requirements:
return orig(repo, subset, x)
# i18n: "filelog" is a keyword

View File

@ -1,4 +1,4 @@
# fileserverclient.py - client for communicating with the file server
# fileserverclient.py - client for communicating with the cache process
#
# Copyright 2013 Facebook, Inc.
#
@ -18,7 +18,6 @@ contentbytes = 0
metadatabytes = 0
_downloading = _('downloading')
_memcache = 'scmmemcache';
client = None
@ -32,6 +31,8 @@ class fileserverclient(object):
def __init__(self, ui):
self.ui = ui
self.cachepath = ui.config("remotefilelog", "cachepath")
self.cacheprocess = ui.config("remotefilelog", "cacheprocess")
self.debugoutput = ui.configbool("remotefilelog", "debug")
self.pipeo = self.pipei = self.pipee = None
@ -139,10 +140,10 @@ class fileserverclient(object):
return missing
def connect(self):
self.pipei, self.pipeo, self.pipee, self.subprocess = util.popen4(_memcache)
self.pipei, self.pipeo, self.pipee, self.subprocess = util.popen4(self.cacheprocess)
def close(self):
if fetches:
if fetches and self.debugoutput:
print ("%s fetched over %d fetches - %0.2f MB (%0.2f MB content / %0.2f MB metadata) " +
"over %0.2fs = %0.2f MB/s") % (
fetched,

View File

@ -1,4 +1,4 @@
# remoterevlog.py - revlog implementation where the content is stored remotely
# remotefilectx.py - filectx and workingfilectx implementations for remotefilelog
#
# Copyright 2013 Facebook, Inc.
#

View File

@ -1,4 +1,4 @@
# remotefilelog.py - revlog implementation where the content is stored remotely
# remotefilelog.py - filelog implementation where filelog history is stored remotely
#
# Copyright 2013 Facebook, Inc.
#

View File

@ -1,4 +1,4 @@
# shallowbundle.py - revlog implementation where the content is stored remotely
# shallowbundle.py - bundle10 implementation for use with shallow repositories
#
# Copyright 2013 Facebook, Inc.
#
@ -14,7 +14,7 @@ from mercurial.i18n import _
shallowremote = False
def shouldaddfilegroups(repo, source):
isshallowclient = "shallowrepo" in repo.requirements
isshallowclient = "remotefilelog" in repo.requirements
if source == "push":
return True
if source == "serve":
@ -65,7 +65,7 @@ def sortnodes(nodes, parentfunc):
class shallowbundle(changegroup.bundle10):
def generate(self, commonrevs, clnodes, fastpathlinkrev, source):
if "shallowrepo" in self._repo.requirements:
if "remotefilelog" in self._repo.requirements:
fastpathlinkrev = False
return super(shallowbundle, self).generate(commonrevs, clnodes,

View File

@ -1,4 +1,4 @@
# shallowrepo.py
# shallowrepo.py - shallow repository that uses remote filelogs
#
# Copyright 2013 Facebook, Inc.
#

View File

@ -1,3 +1,9 @@
# shallowstore.py - shallow store for interacting with shallow repos
#
# Copyright 2013 Facebook, Inc.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from mercurial import util
from mercurial import store as storemod

View File

@ -1,18 +1,18 @@
from distutils.core import setup, Extension
setup(
name='hgshallowrepo',
name='remotefilelog',
version='0.1',
author='Durham Goode',
maintainer='Durham Goode',
maintainer_email='durham@fb.com',
url='https://bitbucket.org/facebook/hgshallowrepo',
description='Shallow repo extension for Mercurial',
url='https://bitbucket.org/facebook/remotefilelog',
description='Remote filelog extension for Mercurial',
long_description="""
This extension adds support for shallow repositories in Mercurial where all the file history is stored remotely.
This extension adds support for remote filelogs in Mercurial where all the file history is stored remotely.
""".strip(),
keywords='hg shallow mercurial',
keywords='hg shallow mercurial remote filelog',
license='Not determined yet',
packages=['hgshallowrepo'],
packages=['remotefilelog'],
ext_modules = []
)