Mercurial > public > mercurial-scm > hg-stable
diff hgext/largefiles/lfutil.py @ 18154:93c697d9c158
largefiles: remove trivial portability wrappers
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Thu, 13 Dec 2012 19:19:06 +0100 |
parents | 51837a31b425 |
children | a7a88a458a4c |
line wrap: on
line diff
--- a/hgext/largefiles/lfutil.py Thu Dec 13 19:19:06 2012 +0100 +++ b/hgext/largefiles/lfutil.py Thu Dec 13 19:19:06 2012 +0100 @@ -22,19 +22,6 @@ longname = 'largefiles' -# -- Portability wrappers ---------------------------------------------- - -def dirstatewalk(dirstate, matcher, unknown=False, ignored=False): - return dirstate.walk(matcher, [], unknown, ignored) - -def repoadd(repo, list): - add = repo[None].add - return add(list) - -def repoforget(repo, list): - forget = repo[None].forget - return forget(list) - # -- Private worker functions ------------------------------------------ def getminsize(ui, assumelfiles, opt, default=10): @@ -138,7 +125,7 @@ if create and not os.path.exists(os.path.join(lfstoredir, 'dirstate')): util.makedirs(lfstoredir) matcher = getstandinmatcher(repo) - for standin in dirstatewalk(repo.dirstate, matcher): + for standin in repo.dirstate.walk(matcher, [], False, False): lfile = splitstandin(standin) hash = readstandin(repo, lfile) lfdirstate.normallookup(lfile) @@ -270,8 +257,8 @@ file.''' # Notes: # 1) Some callers want an absolute path, but for instance addlargefiles - # needs it repo-relative so it can be passed to repoadd(). So leave - # it up to the caller to use repo.wjoin() to get an absolute path. + # needs it repo-relative so it can be passed to repo[None].add(). 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 # passed filenames from an external source (like the command line). @@ -429,7 +416,7 @@ def getstandinsstate(repo): standins = [] matcher = getstandinmatcher(repo) - for standin in dirstatewalk(repo.dirstate, matcher): + for standin in repo.dirstate.walk(matcher, [], False, False): lfile = splitstandin(standin) standins.append((lfile, readstandin(repo, lfile))) return standins