[Bug 5794] New: lfs doesn't play well with narrow

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Fri Feb 16 17:34:25 UTC 2018


https://bz.mercurial-scm.org/show_bug.cgi?id=5794

            Bug ID: 5794
           Summary: lfs doesn't play well with narrow
           Product: Mercurial
           Version: default branch
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: lfs
          Assignee: bugzilla at mercurial-scm.org
          Reporter: idlsoft at gmail.com
                CC: mercurial-devel at mercurial-scm.org

I've tried to clone a repository with both narrow and lfs enabled, and got a
LookupError for a file that was excluded from the clone.

The interesting part in the stacktrace is line 230 from lfs/__init__.py:
230:   # TODO: is there a way to just walk the files in the commit?
231:   if any(ctx[f].islfs() for f in ctx.files() if f in ctx):


Here is the full stracktrace: 
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mercurial/scmutil.py", line 154, in
callcatch
    return func()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 314, in
_runcatchfunc
    return _dispatch(req)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 917, in
_dispatch
    cmdpats, cmdoptions)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 674, in
runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 925, in
_runcommand
    return cmdfunc()
  File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 914, in
<lambda>
    d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 1228, in
check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 1228, in
check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/hgext/narrow/narrowcommands.py", line
116, in clonenarrowcmd
    return orig(ui, repo, *args, **pycompat.strkwargs(opts))
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 1228, in
check
    return func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 1450, in
clone
    shareopts=opts.get('shareopts'))
  File "/usr/lib/python2.7/dist-packages/hgext/lfs/wrapper.py", line 227, in
hgclone
    result = orig(ui, opts, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/hg.py", line 680, in clone
    streamclonerequested=stream)
  File "/usr/lib/python2.7/dist-packages/hgext/narrow/narrowcommands.py", line
111, in pullnarrow
    return orig(repo, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/exchange.py", line 1364, in
pull
    _pullbundle2(pullop)
  File "/usr/lib/python2.7/dist-packages/mercurial/exchange.py", line 1541, in
_pullbundle2
    bundle2.processbundle(pullop.repo, bundle, op=op)
  File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py", line 454, in
processbundle
    processparts(repo, op, unbundler)
  File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py", line 461, in
processparts
    _processpart(op, part)
  File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py", line 528, in
_processpart
    handler(op, part)
  File "/usr/lib/python2.7/dist-packages/hgext/narrow/narrowbundle2.py", line
491, in wrappedcghandler
    origcghandler(op, inpart)
  File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py", line 1734, in
handlechangegroup
    expectedtotal=nbchangesets, **extrakwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/bundle2.py", line 464, in
_processchangegroup
    ret = cg.apply(op.repo, tr, source, url, **kwargs)
  File "/usr/lib/python2.7/dist-packages/mercurial/changegroup.py", line 364,
in apply
    throw=True, **pycompat.strkwargs(hookargs))
  File "/usr/lib/python2.7/dist-packages/mercurial/localrepo.py", line 827, in
hook
    return hook.hook(self.ui, self, name, throw, **args)
  File "/usr/lib/python2.7/dist-packages/mercurial/hook.py", line 210, in hook
    res = runhooks(ui, repo, htype, hooks, throw=throw, **args)
  File "/usr/lib/python2.7/dist-packages/mercurial/hook.py", line 246, in
runhooks
    throw)
  File "/usr/lib/python2.7/dist-packages/mercurial/hook.py", line 94, in
_pythonhook
    r = obj(ui=ui, repo=repo, hooktype=htype, **pycompat.strkwargs(args))
  File "/usr/lib/python2.7/dist-packages/hgext/lfs/__init__.py", line 231, in
checkrequireslfs
    if any(ctx[f].islfs() for f in ctx.files() if f in ctx):
  File "/usr/lib/python2.7/dist-packages/hgext/lfs/__init__.py", line 231, in
<genexpr>
    if any(ctx[f].islfs() for f in ctx.files() if f in ctx):
  File "/usr/lib/python2.7/dist-packages/hgext/lfs/wrapper.py", line 179, in
filectxislfs
    return _islfs(self.filelog(), self.filenode())
  File "/usr/lib/python2.7/dist-packages/mercurial/context.py", line 774, in
filenode
    return self._filenode
  File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 966, in
__get__
    result = self.func(obj)
  File "/usr/lib/python2.7/dist-packages/mercurial/context.py", line 722, in
_filenode
    return self._filelog.lookup(self._fileid)
  File "/usr/lib/python2.7/dist-packages/mercurial/revlog.py", line 1448, in
lookup
    raise LookupError(id, self.indexfile, _('no match found'))

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list