[PATCH 4 of 5] largefiles: remove use of underscores that breaks coding convention

Na'Tosha Bard natosha at unity3d.com
Fri Mar 9 10:13:11 CST 2012


# HG changeset patch
# User Na'Tosha Bard <natosha at unity3d.com>
# Date 1331305912 -3600
# Node ID c666b1db76feae3c657013e5d70ebae4454eddc3
# Parent  a536632a5fc5ad897efa840fe4f78dc4025a4ce7
largefiles: remove use of underscores that breaks coding convention

diff -r a536632a5fc5 -r c666b1db76fe hgext/largefiles/basestore.py
--- a/hgext/largefiles/basestore.py	Fri Mar 09 15:26:13 2012 +0100
+++ b/hgext/largefiles/basestore.py	Fri Mar 09 16:11:52 2012 +0100
@@ -114,14 +114,14 @@
             failed = util.any(self._verifyfile(
                 cctx, cset, contents, standin, verified) for standin in cctx)
 
-        num_revs = len(verified)
-        num_lfiles = len(set([fname for (fname, fnode) in verified]))
+        numrevs = len(verified)
+        numlfiles = len(set([fname for (fname, fnode) in verified]))
         if contents:
             write(_('verified contents of %d revisions of %d largefiles\n')
-                  % (num_revs, num_lfiles))
+                  % (numrevs, numlfiles))
         else:
             write(_('verified existence of %d revisions of %d largefiles\n')
-                  % (num_revs, num_lfiles))
+                  % (numrevs, numlfiles))
 
         return int(failed)
 
@@ -186,9 +186,9 @@
     except KeyError:
         raise util.Abort(_('unsupported URL scheme %r') % scheme)
 
-    for class_obj in storeproviders:
+    for classobj in storeproviders:
         try:
-            return class_obj(ui, repo, remote)
+            return classobj(ui, repo, remote)
         except lfutil.storeprotonotcapable:
             pass
 
diff -r a536632a5fc5 -r c666b1db76fe hgext/largefiles/lfcommands.py
--- a/hgext/largefiles/lfcommands.py	Fri Mar 09 15:26:13 2012 +0100
+++ b/hgext/largefiles/lfcommands.py	Fri Mar 09 16:11:52 2012 +0100
@@ -58,7 +58,7 @@
         # Lock destination to prevent modification while it is converted to.
         # Don't need to lock src because we are just reading from its history
         # which can't change.
-        dst_lock = rdst.lock()
+        dstlock = rdst.lock()
 
         # Get a list of all changesets in the source.  The easy way to do this
         # is to simply walk the changelog, using changelog.nodesbewteen().
@@ -113,7 +113,7 @@
         if not success:
             # we failed, remove the new directory
             shutil.rmtree(rdst.root)
-        dst_lock.release()
+        dstlock.release()
 
 def _addchangeset(ui, rsrc, rdst, ctx, revmap):
  # Convert src parents to dst parents
@@ -451,7 +451,7 @@
              expecthash != lfutil.hashfile(abslfile))):
             if not lfutil.copyfromcache(repo, expecthash, lfile):
                 # use normallookup() to allocate entry in largefiles dirstate,
-                # because lack of it misleads lfiles_repo.status() into
+                # because lack of it misleads lfilesrepo.status() into
                 # recognition that such cache missing files are REMOVED.
                 lfdirstate.normallookup(lfile)
                 return None # don't try to set the mode
diff -r a536632a5fc5 -r c666b1db76fe hgext/largefiles/lfutil.py
--- a/hgext/largefiles/lfutil.py	Fri Mar 09 15:26:13 2012 +0100
+++ b/hgext/largefiles/lfutil.py	Fri Mar 09 16:11:52 2012 +0100
@@ -23,14 +23,14 @@
 
 # -- Portability wrappers ----------------------------------------------
 
-def dirstate_walk(dirstate, matcher, unknown=False, ignored=False):
+def dirstatewalk(dirstate, matcher, unknown=False, ignored=False):
     return dirstate.walk(matcher, [], unknown, ignored)
 
-def repo_add(repo, list):
+def repoadd(repo, list):
     add = repo[None].add
     return add(list)
 
-def repo_remove(repo, list, unlink=False):
+def reporemove(repo, list, unlink=False):
     def remove(list, unlink):
         wlock = repo.wlock()
         try:
@@ -46,7 +46,7 @@
             wlock.release()
     return remove(list, unlink=unlink)
 
-def repo_forget(repo, list):
+def repoforget(repo, list):
     forget = repo[None].forget
     return forget(list)
 
@@ -125,21 +125,21 @@
         return path
     return None
 
-class largefiles_dirstate(dirstate.dirstate):
+class largefilesdirstate(dirstate.dirstate):
     def __getitem__(self, key):
-        return super(largefiles_dirstate, self).__getitem__(unixpath(key))
+        return super(largefilesdirstate, self).__getitem__(unixpath(key))
     def normal(self, f):
-        return super(largefiles_dirstate, self).normal(unixpath(f))
+        return super(largefilesdirstate, self).normal(unixpath(f))
     def remove(self, f):
-        return super(largefiles_dirstate, self).remove(unixpath(f))
+        return super(largefilesdirstate, self).remove(unixpath(f))
     def add(self, f):
-        return super(largefiles_dirstate, self).add(unixpath(f))
+        return super(largefilesdirstate, self).add(unixpath(f))
     def drop(self, f):
-        return super(largefiles_dirstate, self).drop(unixpath(f))
+        return super(largefilesdirstate, self).drop(unixpath(f))
     def forget(self, f):
-        return super(largefiles_dirstate, self).forget(unixpath(f))
+        return super(largefilesdirstate, self).forget(unixpath(f))
     def normallookup(self, f):
-        return super(largefiles_dirstate, self).normallookup(unixpath(f))
+        return super(largefilesdirstate, self).normallookup(unixpath(f))
 
 def openlfdirstate(ui, repo):
     '''
@@ -148,7 +148,7 @@
     '''
     admin = repo.join(longname)
     opener = scmutil.opener(admin)
-    lfdirstate = largefiles_dirstate(opener, ui, repo.root,
+    lfdirstate = largefilesdirstate(opener, ui, repo.root,
                                      repo.dirstate._validate)
 
     # If the largefiles dirstate does not exist, populate and create
@@ -157,7 +157,7 @@
     if not os.path.exists(os.path.join(admin, 'dirstate')):
         util.makedirs(admin)
         matcher = getstandinmatcher(repo)
-        for standin in dirstate_walk(repo.dirstate, matcher):
+        for standin in dirstatewalk(repo.dirstate, matcher):
             lfile = splitstandin(standin)
             hash = readstandin(repo, lfile)
             lfdirstate.normallookup(lfile)
@@ -169,7 +169,7 @@
                     raise
     return lfdirstate
 
-def lfdirstate_status(lfdirstate, repo, rev):
+def lfdirstatestatus(lfdirstate, repo, rev):
     match = match_.always(repo.root, repo.getcwd())
     s = lfdirstate.status(match, [], False, False, False)
     unsure, modified, added, removed, missing, unknown, ignored, clean = s
@@ -286,9 +286,9 @@
     as the paths specified by the user.'''
     smatcher = getstandinmatcher(repo, rmatcher.files())
     isstandin = smatcher.matchfn
-    def composed_matchfn(f):
+    def composedmatchfn(f):
         return isstandin(f) and rmatcher.matchfn(splitstandin(f))
-    smatcher.matchfn = composed_matchfn
+    smatcher.matchfn = composedmatchfn
 
     return smatcher
 
@@ -296,8 +296,8 @@
     '''Return the repo-relative path to the standin for the specified big
     file.'''
     # Notes:
-    # 1) Most callers want an absolute path, but _create_standin() needs
-    #    it repo-relative so lfadd() can pass it to repo_add().  So leave
+    # 1) Most callers want an absolute path, but _createstandin() needs
+    #    it repo-relative so lfadd() can pass it to repoadd().  So leave
     #    it up to the caller to use repo.wjoin() to get an absolute path.
     # 2) Join with '/' because that's what dirstate always uses, even on
     #    Windows. Change existing separator to '/' first in case we are
@@ -453,7 +453,7 @@
 def getstandinsstate(repo):
     standins = []
     matcher = getstandinmatcher(repo)
-    for standin in dirstate_walk(repo.dirstate, matcher):
+    for standin in dirstatewalk(repo.dirstate, matcher):
         lfile = splitstandin(standin)
         standins.append((lfile, readstandin(repo, lfile)))
     return standins
diff -r a536632a5fc5 -r c666b1db76fe hgext/largefiles/overrides.py
--- a/hgext/largefiles/overrides.py	Fri Mar 09 15:26:13 2012 +0100
+++ b/hgext/largefiles/overrides.py	Fri Mar 09 16:11:52 2012 +0100
@@ -26,7 +26,7 @@
     '''overrides scmutil.match so that the matcher it returns will ignore all
     largefiles'''
     oldmatch = None # for the closure
-    def override_match(ctx, pats=[], opts={}, globbed=False,
+    def overridematch(ctx, pats=[], opts={}, globbed=False,
             default='relpath'):
         match = oldmatch(ctx, pats, opts, globbed, default)
         m = copy.copy(match)
@@ -34,10 +34,10 @@
                 manifest)
         m._files = filter(notlfile, m._files)
         m._fmap = set(m._files)
-        orig_matchfn = m.matchfn
-        m.matchfn = lambda f: notlfile(f) and orig_matchfn(f) or None
+        origmatchfn = m.matchfn
+        m.matchfn = lambda f: notlfile(f) and origmatchfn(f) or None
         return m
-    oldmatch = installmatchfn(override_match)
+    oldmatch = installmatchfn(overridematch)
 
 def installmatchfn(f):
     oldmatch = scmutil.match
@@ -53,7 +53,7 @@
     restore matchfn to reverse'''
     scmutil.match = getattr(scmutil.match, 'oldmatch', scmutil.match)
 
-def add_largefiles(ui, repo, *pats, **opts):
+def addlargefiles(ui, repo, *pats, **opts):
     large = opts.pop('large', None)
     lfsize = lfutil.getminsize(
         ui, lfutil.islfilesrepo(repo), opts.pop('lfsize', None))
@@ -109,13 +109,13 @@
                     lfdirstate.add(f)
             lfdirstate.write()
             bad += [lfutil.splitstandin(f)
-                    for f in lfutil.repo_add(repo, standins)
+                    for f in lfutil.repoadd(repo, standins)
                     if f in m.files()]
     finally:
         wlock.release()
     return bad
 
-def remove_largefiles(ui, repo, *pats, **opts):
+def removelargefiles(ui, repo, *pats, **opts):
     after = opts.get('after')
     if not pats and not after:
         raise util.Abort(_('no files specified'))
@@ -164,11 +164,11 @@
         lfdirstate.write()
         forget = [lfutil.standin(f) for f in forget]
         remove = [lfutil.standin(f) for f in remove]
-        lfutil.repo_forget(repo, forget)
+        lfutil.repoforget(repo, forget)
         # If this is being called by addremove, let the original addremove
         # function handle this.
         if not getattr(repo, "_isaddremove", False):
-            lfutil.repo_remove(repo, remove, unlink=True)
+            lfutil.reporemove(repo, remove, unlink=True)
     finally:
         wlock.release()
 
@@ -178,40 +178,40 @@
 # checking if they should be added as largefiles. Then it makes a new
 # matcher which matches only the normal files and runs the original
 # version of add.
-def override_add(orig, ui, repo, *pats, **opts):
+def overrideadd(orig, ui, repo, *pats, **opts):
     normal = opts.pop('normal')
     if normal:
         if opts.get('large'):
             raise util.Abort(_('--normal cannot be used with --large'))
         return orig(ui, repo, *pats, **opts)
-    bad = add_largefiles(ui, repo, *pats, **opts)
+    bad = addlargefiles(ui, repo, *pats, **opts)
     installnormalfilesmatchfn(repo[None].manifest())
     result = orig(ui, repo, *pats, **opts)
     restorematchfn()
 
     return (result == 1 or bad) and 1 or 0
 
-def override_remove(orig, ui, repo, *pats, **opts):
+def overrideremove(orig, ui, repo, *pats, **opts):
     installnormalfilesmatchfn(repo[None].manifest())
     orig(ui, repo, *pats, **opts)
     restorematchfn()
-    remove_largefiles(ui, repo, *pats, **opts)
+    removelargefiles(ui, repo, *pats, **opts)
 
-def override_status(orig, ui, repo, *pats, **opts):
+def overridestatus(orig, ui, repo, *pats, **opts):
     try:
         repo.lfstatus = True
         return orig(ui, repo, *pats, **opts)
     finally:
         repo.lfstatus = False
 
-def override_log(orig, ui, repo, *pats, **opts):
+def overridelog(orig, ui, repo, *pats, **opts):
     try:
         repo.lfstatus = True
         orig(ui, repo, *pats, **opts)
     finally:
         repo.lfstatus = False
 
-def override_verify(orig, ui, repo, *pats, **opts):
+def overrideverify(orig, ui, repo, *pats, **opts):
     large = opts.pop('large', False)
     all = opts.pop('lfa', False)
     contents = opts.pop('lfc', False)
@@ -225,7 +225,7 @@
 # will go through properly. Then the other update hook (overriding repo.update)
 # will get the new files. Filemerge is also overriden so that the merge
 # will merge standins correctly.
-def override_update(orig, ui, repo, *pats, **opts):
+def overrideupdate(orig, ui, repo, *pats, **opts):
     lfdirstate = lfutil.openlfdirstate(ui, repo)
     s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [], False,
         False, False)
@@ -265,7 +265,7 @@
 # The overridden function filters the unknown files by removing any
 # largefiles. This makes the merge proceed and we can then handle this
 # case further in the overridden manifestmerge function below.
-def override_checkunknownfile(origfn, repo, wctx, mctx, f):
+def overridecheckunknownfile(origfn, repo, wctx, mctx, f):
     if lfutil.standin(f) in wctx:
         return False
     return origfn(repo, wctx, mctx, f)
@@ -296,7 +296,7 @@
 # Finally, the merge.applyupdates function will then take care of
 # writing the files into the working copy and lfcommands.updatelfiles
 # will update the largefiles.
-def override_manifestmerge(origfn, repo, p1, p2, pa, overwrite, partial):
+def overridemanifestmerge(origfn, repo, p1, p2, pa, overwrite, partial):
     actions = origfn(repo, p1, p2, pa, overwrite, partial)
     processed = []
 
@@ -339,7 +339,7 @@
 # Override filemerge to prompt the user about how they wish to merge
 # largefiles. This will handle identical edits, and copy/rename +
 # edit without prompting the user.
-def override_filemerge(origfn, repo, mynode, orig, fcd, fco, fca):
+def overridefilemerge(origfn, repo, mynode, orig, fcd, fco, fca):
     # Use better variable names here. Because this is a wrapper we cannot
     # change the variable names in the function declaration.
     fcdest, fcother, fcancestor = fcd, fco, fca
@@ -384,7 +384,7 @@
 # checks if the destination largefile already exists. It also keeps a
 # list of copied files so that the largefiles can be copied and the
 # dirstate updated.
-def override_copy(orig, ui, repo, pats, opts, rename=False):
+def overridecopy(orig, ui, repo, pats, opts, rename=False):
     # doesn't remove largefile on rename
     if len(pats) < 2:
         # this isn't legal, let the original function deal with it
@@ -434,7 +434,7 @@
 
             manifest = repo[None].manifest()
             oldmatch = None # for the closure
-            def override_match(ctx, pats=[], opts={}, globbed=False,
+            def overridematch(ctx, pats=[], opts={}, globbed=False,
                     default='relpath'):
                 newpats = []
                 # The patterns were previously mangled to add the standin
@@ -449,13 +449,13 @@
                 lfile = lambda f: lfutil.standin(f) in manifest
                 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
                 m._fmap = set(m._files)
-                orig_matchfn = m.matchfn
+                origmatchfn = m.matchfn
                 m.matchfn = lambda f: (lfutil.isstandin(f) and
                                     (f in manifest) and
-                                    orig_matchfn(lfutil.splitstandin(f)) or
+                                    origmatchfn(lfutil.splitstandin(f)) or
                                     None)
                 return m
-            oldmatch = installmatchfn(override_match)
+            oldmatch = installmatchfn(overridematch)
             listpats = []
             for pat in pats:
                 if match_.patkind(pat) is not None:
@@ -466,7 +466,7 @@
             try:
                 origcopyfile = util.copyfile
                 copiedfiles = []
-                def override_copyfile(src, dest):
+                def overridecopyfile(src, dest):
                     if (lfutil.shortname in src and
                         dest.startswith(repo.wjoin(lfutil.shortname))):
                         destlfile = dest.replace(lfutil.shortname, '')
@@ -476,7 +476,7 @@
                     copiedfiles.append((src, dest))
                     origcopyfile(src, dest)
 
-                util.copyfile = override_copyfile
+                util.copyfile = overridecopyfile
                 result += orig(ui, repo, listpats, opts, rename)
             finally:
                 util.copyfile = origcopyfile
@@ -521,7 +521,7 @@
 # the matcher to hit standins instead of largefiles. Based on the
 # resulting standins update the largefiles. Then return the standins
 # to their proper state
-def override_revert(orig, ui, repo, *pats, **opts):
+def overriderevert(orig, ui, repo, *pats, **opts):
     # Because we put the standins in a bad state (by updating them)
     # and then return them to a correct state we need to lock to
     # prevent others from changing them in their incorrect state.
@@ -529,7 +529,7 @@
     try:
         lfdirstate = lfutil.openlfdirstate(ui, repo)
         (modified, added, removed, missing, unknown, ignored, clean) = \
-            lfutil.lfdirstate_status(lfdirstate, repo, repo['.'].rev())
+            lfutil.lfdirstatestatus(lfdirstate, repo, repo['.'].rev())
         for lfile in modified:
             lfutil.updatestandin(repo, lfutil.standin(lfile))
         for lfile in missing:
@@ -538,7 +538,7 @@
         try:
             ctx = repo[opts.get('rev')]
             oldmatch = None # for the closure
-            def override_match(ctx, pats=[], opts={}, globbed=False,
+            def overridematch(ctx, pats=[], opts={}, globbed=False,
                     default='relpath'):
                 match = oldmatch(ctx, pats, opts, globbed, default)
                 m = copy.copy(match)
@@ -551,7 +551,7 @@
                 m._files = [tostandin(f) for f in m._files]
                 m._files = [f for f in m._files if f is not None]
                 m._fmap = set(m._files)
-                orig_matchfn = m.matchfn
+                origmatchfn = m.matchfn
                 def matchfn(f):
                     if lfutil.isstandin(f):
                         # We need to keep track of what largefiles are being
@@ -560,7 +560,7 @@
                         # largefiles. This is repo-specific, so duckpunch the
                         # repo object to keep the list of largefiles for us
                         # later.
-                        if orig_matchfn(lfutil.splitstandin(f)) and \
+                        if origmatchfn(lfutil.splitstandin(f)) and \
                                 (f in repo[None] or f in ctx):
                             lfileslist = getattr(repo, '_lfilestoupdate', [])
                             lfileslist.append(lfutil.splitstandin(f))
@@ -568,12 +568,12 @@
                             return True
                         else:
                             return False
-                    return orig_matchfn(f)
+                    return origmatchfn(f)
                 m.matchfn = matchfn
                 return m
-            oldmatch = installmatchfn(override_match)
+            oldmatch = installmatchfn(overridematch)
             scmutil.match
-            matches = override_match(repo[None], pats, opts)
+            matches = overridematch(repo[None], pats, opts)
             orig(ui, repo, *pats, **opts)
         finally:
             restorematchfn()
@@ -601,7 +601,7 @@
     finally:
         wlock.release()
 
-def hg_update(orig, repo, node):
+def hgupdate(orig, repo, node):
     # Only call updatelfiles the standins that have changed to save time
     oldstandins = lfutil.getstandinsstate(repo)
     result = orig(repo, node)
@@ -610,12 +610,12 @@
     lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, printmessage=True)
     return result
 
-def hg_clean(orig, repo, node, show_stats=True):
+def hgclean(orig, repo, node, show_stats=True):
     result = orig(repo, node, show_stats)
     lfcommands.updatelfiles(repo.ui, repo)
     return result
 
-def hg_merge(orig, repo, node, force=None, remind=True):
+def hgmerge(orig, repo, node, force=None, remind=True):
     # Mark the repo as being in the middle of a merge, so that
     # updatelfiles() will know that it needs to trust the standins in
     # the working copy, not in the standins in the current node
@@ -634,7 +634,7 @@
 # When we rebase a repository with remotely changed largefiles, we need to
 # take some extra care so that the largefiles are correctly updated in the
 # working copy
-def override_pull(orig, ui, repo, source=None, **opts):
+def overridepull(orig, ui, repo, source=None, **opts):
     if opts.get('rebase', False):
         repo._isrebasing = True
         try:
@@ -681,14 +681,14 @@
         ui.status(_("%d largefiles cached\n") % numcached)
     return result
 
-def override_rebase(orig, ui, repo, **opts):
+def overriderebase(orig, ui, repo, **opts):
     repo._isrebasing = True
     try:
         orig(ui, repo, **opts)
     finally:
         repo._isrebasing = False
 
-def override_archive(orig, repo, dest, node, kind, decode=True, matchfn=None,
+def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
             prefix=None, mtime=None, subrepos=None):
     # No need to lock because we are only reading history and
     # largefile caches, neither of which are modified.
@@ -770,7 +770,7 @@
 # standin until a commit. cmdutil.bailifchanged() raises an exception
 # if the repo has uncommitted changes. Wrap it to also check if
 # largefiles were changed. This is used by bisect and backout.
-def override_bailifchanged(orig, repo):
+def overridebailifchanged(orig, repo):
     orig(repo)
     repo.lfstatus = True
     modified, added, removed, deleted = repo.status()[:4]
@@ -778,8 +778,8 @@
     if modified or added or removed or deleted:
         raise util.Abort(_('outstanding uncommitted changes'))
 
-# Fetch doesn't use cmdutil.bail_if_changed so override it to add the check
-def override_fetch(orig, ui, repo, *pats, **opts):
+# Fetch doesn't use cmdutil.bailifchanged so override it to add the check
+def overridefetch(orig, ui, repo, *pats, **opts):
     repo.lfstatus = True
     modified, added, removed, deleted = repo.status()[:4]
     repo.lfstatus = False
@@ -787,7 +787,7 @@
         raise util.Abort(_('outstanding uncommitted changes'))
     return orig(ui, repo, *pats, **opts)
 
-def override_forget(orig, ui, repo, *pats, **opts):
+def overrideforget(orig, ui, repo, *pats, **opts):
     installnormalfilesmatchfn(repo[None].manifest())
     orig(ui, repo, *pats, **opts)
     restorematchfn()
@@ -822,7 +822,7 @@
             else:
                 lfdirstate.remove(f)
         lfdirstate.write()
-        lfutil.repo_remove(repo, [lfutil.standin(f) for f in forget],
+        lfutil.reporemove(repo, [lfutil.standin(f) for f in forget],
             unlink=True)
     finally:
         wlock.release()
@@ -869,7 +869,7 @@
             set([f for f in files if lfutil.isstandin(f) and f in ctx]))
     return toupload
 
-def override_outgoing(orig, ui, repo, dest=None, **opts):
+def overrideoutgoing(orig, ui, repo, dest=None, **opts):
     orig(ui, repo, dest, **opts)
 
     if opts.pop('large', None):
@@ -882,7 +882,7 @@
                 ui.status(lfutil.splitstandin(file) + '\n')
             ui.status('\n')
 
-def override_summary(orig, ui, repo, *pats, **opts):
+def overridesummary(orig, ui, repo, *pats, **opts):
     try:
         repo.lfstatus = True
         orig(ui, repo, *pats, **opts)
@@ -896,7 +896,7 @@
         else:
             ui.status(_('largefiles: %d to upload\n') % len(toupload))
 
-def override_addremove(orig, ui, repo, *pats, **opts):
+def overrideaddremove(orig, ui, repo, *pats, **opts):
     # Get the list of missing largefiles so we can remove them
     lfdirstate = lfutil.openlfdirstate(ui, repo)
     s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [], False,
@@ -909,11 +909,11 @@
     # confused state later.
     if missing:
         repo._isaddremove = True
-        remove_largefiles(ui, repo, *missing, **opts)
+        removelargefiles(ui, repo, *missing, **opts)
         repo._isaddremove = False
     # Call into the normal add code, and any files that *should* be added as
     # largefiles will be
-    add_largefiles(ui, repo, *pats, **opts)
+    addlargefiles(ui, repo, *pats, **opts)
     # Now that we've handled largefiles, hand off to the original addremove
     # function to take care of the rest.  Make sure it doesn't do anything with
     # largefiles by installing a matcher that will ignore them.
@@ -924,9 +924,9 @@
 
 # Calling purge with --all will cause the largefiles to be deleted.
 # Override repo.status to prevent this from happening.
-def override_purge(orig, ui, repo, *dirs, **opts):
+def overridepurge(orig, ui, repo, *dirs, **opts):
     oldstatus = repo.status
-    def override_status(node1='.', node2=None, match=None, ignored=False,
+    def overridestatus(node1='.', node2=None, match=None, ignored=False,
                         clean=False, unknown=False, listsubrepos=False):
         r = oldstatus(node1, node2, match, ignored, clean, unknown,
                       listsubrepos)
@@ -935,11 +935,11 @@
         unknown = [f for f in unknown if lfdirstate[f] == '?']
         ignored = [f for f in ignored if lfdirstate[f] == '?']
         return modified, added, removed, deleted, unknown, ignored, clean
-    repo.status = override_status
+    repo.status = overridestatus
     orig(ui, repo, *dirs, **opts)
     repo.status = oldstatus
 
-def override_rollback(orig, ui, repo, **opts):
+def overriderollback(orig, ui, repo, **opts):
     result = orig(ui, repo, **opts)
     merge.update(repo, node=None, branchmerge=False, force=True,
         partial=lfutil.isstandin)
@@ -958,7 +958,7 @@
         wlock.release()
     return result
 
-def override_transplant(orig, ui, repo, *revs, **opts):
+def overridetransplant(orig, ui, repo, *revs, **opts):
     try:
         oldstandins = lfutil.getstandinsstate(repo)
         repo._istransplanting = True
diff -r a536632a5fc5 -r c666b1db76fe hgext/largefiles/proto.py
--- a/hgext/largefiles/proto.py	Fri Mar 09 15:26:13 2012 +0100
+++ b/hgext/largefiles/proto.py	Fri Mar 09 16:11:52 2012 +0100
@@ -131,15 +131,15 @@
 
 # advertise the largefiles=serve capability
 def capabilities(repo, proto):
-    return capabilities_orig(repo, proto) + ' largefiles=serve'
+    return capabilitiesorig(repo, proto) + ' largefiles=serve'
 
 # duplicate what Mercurial's new out-of-band errors mechanism does, because
 # clients old and new alike both handle it well
-def webproto_refuseclient(self, message):
+def webprotorefuseclient(self, message):
     self.req.header([('Content-Type', 'application/hg-error')])
     return message
 
-def sshproto_refuseclient(self, message):
+def sshprotorefuseclient(self, message):
     self.ui.write_err('%s\n-\n' % message)
     self.fout.write('\n')
     self.fout.flush()
@@ -151,16 +151,16 @@
         return wireproto.ooberror(LARGEFILES_REQUIRED_MSG)
     return wireproto.heads(repo, proto)
 
-def sshrepo_callstream(self, cmd, **args):
+def sshrepocallstream(self, cmd, **args):
     if cmd == 'heads' and self.capable('largefiles'):
         cmd = 'lheads'
     if cmd == 'batch' and self.capable('largefiles'):
         args['cmds'] = args['cmds'].replace('heads ', 'lheads ')
-    return ssh_oldcallstream(self, cmd, **args)
+    return ssholdcallstream(self, cmd, **args)
 
-def httprepo_callstream(self, cmd, **args):
+def httprepocallstream(self, cmd, **args):
     if cmd == 'heads' and self.capable('largefiles'):
         cmd = 'lheads'
     if cmd == 'batch' and self.capable('largefiles'):
         args['cmds'] = args['cmds'].replace('heads ', 'lheads ')
-    return http_oldcallstream(self, cmd, **args)
+    return httpoldcallstream(self, cmd, **args)
diff -r a536632a5fc5 -r c666b1db76fe hgext/largefiles/reposetup.py
--- a/hgext/largefiles/reposetup.py	Fri Mar 09 15:26:13 2012 +0100
+++ b/hgext/largefiles/reposetup.py	Fri Mar 09 16:11:52 2012 +0100
@@ -34,54 +34,54 @@
                     'largefiles may behave incorrectly\n')
                     % name)
 
-    class lfiles_repo(repo.__class__):
+    class lfilesrepo(repo.__class__):
         lfstatus = False
         def status_nolfiles(self, *args, **kwargs):
-            return super(lfiles_repo, self).status(*args, **kwargs)
+            return super(lfilesrepo, self).status(*args, **kwargs)
 
         # When lfstatus is set, return a context that gives the names
         # of largefiles instead of their corresponding standins and
         # identifies the largefiles as always binary, regardless of
         # their actual contents.
         def __getitem__(self, changeid):
-            ctx = super(lfiles_repo, self).__getitem__(changeid)
+            ctx = super(lfilesrepo, self).__getitem__(changeid)
             if self.lfstatus:
-                class lfiles_manifestdict(manifest.manifestdict):
+                class lfilesmanifestdict(manifest.manifestdict):
                     def __contains__(self, filename):
-                        if super(lfiles_manifestdict,
+                        if super(lfilesmanifestdict,
                                 self).__contains__(filename):
                             return True
-                        return super(lfiles_manifestdict,
+                        return super(lfilesmanifestdict,
                             self).__contains__(lfutil.standin(filename))
-                class lfiles_ctx(ctx.__class__):
+                class lfilesctx(ctx.__class__):
                     def files(self):
-                        filenames = super(lfiles_ctx, self).files()
+                        filenames = super(lfilesctx, self).files()
                         return [lfutil.splitstandin(f) or f for f in filenames]
                     def manifest(self):
-                        man1 = super(lfiles_ctx, self).manifest()
-                        man1.__class__ = lfiles_manifestdict
+                        man1 = super(lfilesctx, self).manifest()
+                        man1.__class__ = lfilesmanifestdict
                         return man1
                     def filectx(self, path, fileid=None, filelog=None):
                         try:
                             if filelog is not None:
-                                result = super(lfiles_ctx, self).filectx(
+                                result = super(lfilesctx, self).filectx(
                                     path, fileid, filelog)
                             else:
-                                result = super(lfiles_ctx, self).filectx(
+                                result = super(lfilesctx, self).filectx(
                                     path, fileid)
                         except error.LookupError:
                             # Adding a null character will cause Mercurial to
                             # identify this as a binary file.
                             if filelog is not None:
-                                result = super(lfiles_ctx, self).filectx(
+                                result = super(lfilesctx, self).filectx(
                                     lfutil.standin(path), fileid, filelog)
                             else:
-                                result = super(lfiles_ctx, self).filectx(
+                                result = super(lfilesctx, self).filectx(
                                     lfutil.standin(path), fileid)
                             olddata = result.data
                             result.data = lambda: olddata() + '\0'
                         return result
-                ctx.__class__ = lfiles_ctx
+                ctx.__class__ = lfilesctx
             return ctx
 
         # Figure out the status of big files and insert them into the
@@ -92,7 +92,7 @@
                 clean=False, unknown=False, listsubrepos=False):
             listignored, listclean, listunknown = ignored, clean, unknown
             if not self.lfstatus:
-                return super(lfiles_repo, self).status(node1, node2, match,
+                return super(lfilesrepo, self).status(node1, node2, match,
                     listignored, listclean, listunknown, listsubrepos)
             else:
                 # some calls in this function rely on the old version of status
@@ -130,7 +130,7 @@
                         if match(f):
                             break
                     else:
-                        return super(lfiles_repo, self).status(node1, node2,
+                        return super(lfilesrepo, self).status(node1, node2,
                                 match, listignored, listclean,
                                 listunknown, listsubrepos)
 
@@ -154,7 +154,7 @@
 
                 # Get ignored files here even if we weren't asked for them; we
                 # must use the result here for filtering later
-                result = super(lfiles_repo, self).status(node1, node2, m,
+                result = super(lfilesrepo, self).status(node1, node2, m,
                     True, clean, unknown, listsubrepos)
                 if working:
                     try:
@@ -164,7 +164,7 @@
                         # super's status.
                         # Override lfdirstate's ignore matcher to not do
                         # anything
-                        orig_ignore = lfdirstate._ignore
+                        origignore = lfdirstate._ignore
                         lfdirstate._ignore = _ignoreoverride
 
                         match._files = [f for f in match._files if f in
@@ -209,7 +209,7 @@
                                     added.append(lfile)
                     finally:
                         # Replace the original ignore function
-                        lfdirstate._ignore = orig_ignore
+                        lfdirstate._ignore = origignore
 
                     for standin in ctx1.manifest():
                         if not lfutil.isstandin(standin):
@@ -265,7 +265,7 @@
         # As part of committing, copy all of the largefiles into the
         # cache.
         def commitctx(self, *args, **kwargs):
-            node = super(lfiles_repo, self).commitctx(*args, **kwargs)
+            node = super(lfilesrepo, self).commitctx(*args, **kwargs)
             lfutil.copyalltostore(self, node)
             return node
 
@@ -274,7 +274,7 @@
         # Do that here.
         def commit(self, text="", user=None, date=None, match=None,
                 force=False, editor=False, extra={}):
-            orig = super(lfiles_repo, self).commit
+            orig = super(lfilesrepo, self).commit
 
             wlock = repo.wlock()
             try:
@@ -343,7 +343,7 @@
                 # Case 2: user calls commit with specified patterns: refresh
                 # any matching big files.
                 smatcher = lfutil.composestandinmatcher(self, match)
-                standins = lfutil.dirstate_walk(self.dirstate, smatcher)
+                standins = lfutil.dirstatewalk(self.dirstate, smatcher)
 
                 # No matching big files: get out of the way and pass control to
                 # the usual commit() method.
@@ -371,7 +371,7 @@
                 # complaining "not tracked" for big files.
                 lfiles = lfutil.listlfiles(repo)
                 match = copy.copy(match)
-                orig_matchfn = match.matchfn
+                origmatchfn = match.matchfn
 
                 # Check both the list of largefiles and the list of
                 # standins because if a largefile was removed, it
@@ -398,7 +398,7 @@
                 match._files = actualfiles
 
                 def matchfn(f):
-                    if orig_matchfn(f):
+                    if origmatchfn(f):
                         return f not in lfiles
                     else:
                         return f in standins
@@ -443,10 +443,10 @@
                              for f in files
                              if lfutil.isstandin(f) and f in ctx]))
                 lfcommands.uploadlfiles(ui, self, remote, toupload)
-            return super(lfiles_repo, self).push(remote, force, revs,
+            return super(lfilesrepo, self).push(remote, force, revs,
                 newbranch)
 
-    repo.__class__ = lfiles_repo
+    repo.__class__ = lfilesrepo
 
     def checkrequireslfiles(ui, repo, **kwargs):
         if 'largefiles' not in repo.requirements and util.any(
diff -r a536632a5fc5 -r c666b1db76fe hgext/largefiles/uisetup.py
--- a/hgext/largefiles/uisetup.py	Fri Mar 09 15:26:13 2012 +0100
+++ b/hgext/largefiles/uisetup.py	Fri Mar 09 16:11:52 2012 +0100
@@ -21,7 +21,7 @@
     # files in the result are under Mercurial's control
 
     entry = extensions.wrapcommand(commands.table, 'add',
-                                   overrides.override_add)
+                                   overrides.overrideadd)
     addopt = [('', 'large', None, _('add as largefile')),
               ('', 'normal', None, _('add as normal file')),
               ('', 'lfsize', '', _('add all files above this size '
@@ -30,19 +30,19 @@
     entry[1].extend(addopt)
 
     entry = extensions.wrapcommand(commands.table, 'addremove',
-            overrides.override_addremove)
+            overrides.overrideaddremove)
     entry = extensions.wrapcommand(commands.table, 'remove',
-                                   overrides.override_remove)
+                                   overrides.overrideremove)
     entry = extensions.wrapcommand(commands.table, 'forget',
-                                   overrides.override_forget)
+                                   overrides.overrideforget)
     entry = extensions.wrapcommand(commands.table, 'status',
-                                   overrides.override_status)
+                                   overrides.overridestatus)
     entry = extensions.wrapcommand(commands.table, 'log',
-                                   overrides.override_log)
+                                   overrides.overridelog)
     entry = extensions.wrapcommand(commands.table, 'rollback',
-                                   overrides.override_rollback)
+                                   overrides.overriderollback)
     entry = extensions.wrapcommand(commands.table, 'verify',
-                                   overrides.override_verify)
+                                   overrides.overrideverify)
 
     verifyopt = [('', 'large', None, _('verify largefiles')),
                  ('', 'lfa', None,
@@ -52,44 +52,44 @@
     entry[1].extend(verifyopt)
 
     entry = extensions.wrapcommand(commands.table, 'outgoing',
-        overrides.override_outgoing)
+        overrides.overrideoutgoing)
     outgoingopt = [('', 'large', None, _('display outgoing largefiles'))]
     entry[1].extend(outgoingopt)
     entry = extensions.wrapcommand(commands.table, 'summary',
-                                   overrides.override_summary)
+                                   overrides.overridesummary)
     summaryopt = [('', 'large', None, _('display outgoing largefiles'))]
     entry[1].extend(summaryopt)
 
     entry = extensions.wrapcommand(commands.table, 'update',
-                                   overrides.override_update)
+                                   overrides.overrideupdate)
     entry = extensions.wrapcommand(commands.table, 'pull',
-                                   overrides.override_pull)
+                                   overrides.overridepull)
     entry = extensions.wrapfunction(merge, '_checkunknownfile',
-                                    overrides.override_checkunknownfile)
+                                    overrides.overridecheckunknownfile)
     entry = extensions.wrapfunction(merge, 'manifestmerge',
-                                    overrides.override_manifestmerge)
+                                    overrides.overridemanifestmerge)
     entry = extensions.wrapfunction(filemerge, 'filemerge',
-                                    overrides.override_filemerge)
+                                    overrides.overridefilemerge)
     entry = extensions.wrapfunction(cmdutil, 'copy',
-                                    overrides.override_copy)
+                                    overrides.overridecopy)
 
     # Backout calls revert so we need to override both the command and the
     # function
     entry = extensions.wrapcommand(commands.table, 'revert',
-                                   overrides.override_revert)
+                                   overrides.overriderevert)
     entry = extensions.wrapfunction(commands, 'revert',
-                                    overrides.override_revert)
+                                    overrides.overriderevert)
 
     # clone uses hg._update instead of hg.update even though they are the
     # same function... so wrap both of them)
-    extensions.wrapfunction(hg, 'update', overrides.hg_update)
-    extensions.wrapfunction(hg, '_update', overrides.hg_update)
-    extensions.wrapfunction(hg, 'clean', overrides.hg_clean)
-    extensions.wrapfunction(hg, 'merge', overrides.hg_merge)
+    extensions.wrapfunction(hg, 'update', overrides.hgupdate)
+    extensions.wrapfunction(hg, '_update', overrides.hgupdate)
+    extensions.wrapfunction(hg, 'clean', overrides.hgclean)
+    extensions.wrapfunction(hg, 'merge', overrides.hgmerge)
 
-    extensions.wrapfunction(archival, 'archive', overrides.override_archive)
+    extensions.wrapfunction(archival, 'archive', overrides.overridearchive)
     extensions.wrapfunction(cmdutil, 'bailifchanged',
-                            overrides.override_bailifchanged)
+                            overrides.overridebailifchanged)
 
     # create the new wireproto commands ...
     wireproto.commands['putlfile'] = (proto.putlfile, 'sha')
@@ -109,20 +109,20 @@
 
     # the hello wireproto command uses wireproto.capabilities, so it won't see
     # our largefiles capability unless we replace the actual function as well.
-    proto.capabilities_orig = wireproto.capabilities
+    proto.capabilitiesorig = wireproto.capabilities
     wireproto.capabilities = proto.capabilities
 
     # these let us reject non-largefiles clients and make them display
     # our error messages
-    protocol.webproto.refuseclient = proto.webproto_refuseclient
-    sshserver.sshserver.refuseclient = proto.sshproto_refuseclient
+    protocol.webproto.refuseclient = proto.webprotorefuseclient
+    sshserver.sshserver.refuseclient = proto.sshprotorefuseclient
 
     # can't do this in reposetup because it needs to have happened before
     # wirerepo.__init__ is called
-    proto.ssh_oldcallstream = sshrepo.sshrepository._callstream
-    proto.http_oldcallstream = httprepo.httprepository._callstream
-    sshrepo.sshrepository._callstream = proto.sshrepo_callstream
-    httprepo.httprepository._callstream = proto.httprepo_callstream
+    proto.ssholdcallstream = sshrepo.sshrepository._callstream
+    proto.httpoldcallstream = httprepo.httprepository._callstream
+    sshrepo.sshrepository._callstream = proto.sshrepocallstream
+    httprepo.httprepository._callstream = proto.httprepocallstream
 
     # don't die on seeing a repo with the largefiles requirement
     localrepo.localrepository.supported |= set(['largefiles'])
@@ -131,13 +131,13 @@
     for name, module in extensions.extensions():
         if name == 'fetch':
             extensions.wrapcommand(getattr(module, 'cmdtable'), 'fetch',
-                overrides.override_fetch)
+                overrides.overridefetch)
         if name == 'purge':
             extensions.wrapcommand(getattr(module, 'cmdtable'), 'purge',
-                overrides.override_purge)
+                overrides.overridepurge)
         if name == 'rebase':
             extensions.wrapcommand(getattr(module, 'cmdtable'), 'rebase',
-                overrides.override_rebase)
+                overrides.overriderebase)
         if name == 'transplant':
             extensions.wrapcommand(getattr(module, 'cmdtable'), 'transplant',
-                overrides.override_transplant)
+                overrides.overridetransplant)


More information about the Mercurial-devel mailing list