[PATCH] tests: document a known failing interaction between narrow and lfs

Matt Harbison mharbison72 at gmail.com
Wed Nov 14 05:11:43 UTC 2018


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1542171263 18000
#      Tue Nov 13 23:54:23 2018 -0500
# Node ID 9b3e22e87fc38c5e2ffd66b5ba044be810cdd500
# Parent  d2c997b8001ff5fff0ae3d042362f321a707dd55
tests: document a known failing interaction between narrow and lfs

This is one of the two remaining aborts I found looking into issue5794.  I've
got no idea what's wrong with the hook, since the changes there fixed the other
two problems noted in that bug report.  It seems like it might go away when the
narrow issue is fixed, but let's make sure this doesn't get lost.

The stacktrace for the hook seems to indicate that the missing file *is* in ctx:

  remote: Traceback (most recent call last):
  remote:   File "c:\Users\Matt\projects\hg\hgext\lfs\__init__.py", line 253, in checkrequireslfs
  remote:     if any(f in ctx and match(f) and ctx[f].islfs() for f in ctx.files()):
  remote:   File "c:\Users\Matt\projects\hg\hgext\lfs\__init__.py", line 253, in <genexpr>
  remote:     if any(f in ctx and match(f) and ctx[f].islfs() for f in ctx.files()):
  remote:   File "c:\Users\Matt\projects\hg\hgext\lfs\wrapper.py", line 191, in filectxislfs
  remote:     return _islfs(self.filelog(), self.filenode())
  remote:   File "c:\Users\Matt\projects\hg\mercurial\context.py", line 631, in filenode
  remote:     return self._filenode
  remote:   File "c:\Users\Matt\projects\hg\mercurial\util.py", line 1528, in __get__
  remote:     result = self.func(obj)
  remote:   File "c:\Users\Matt\projects\hg\mercurial\context.py", line 579, in _filenode
  remote:     return self._filelog.lookup(self._fileid)
  remote:   File "c:\Users\Matt\projects\hg\mercurial\filelog.py", line 68, in lookup
  remote:     self._revlog.indexfile)
  remote:   File "c:\Users\Matt\projects\hg\mercurial\utils\storageutil.py", line 218, in fileidlookup
  remote:     raise error.LookupError(fileid, identifier, _('no match found'))
  remote: LookupError: data/inside2/f.i at f59b4e021835: no match found

diff --git a/tests/test-narrow-exchange.t b/tests/test-narrow-exchange.t
--- a/tests/test-narrow-exchange.t
+++ b/tests/test-narrow-exchange.t
@@ -1,3 +1,11 @@
+#testcases lfs-on lfs-off
+
+#if lfs-on
+  $ cat >> $HGRCPATH <<EOF
+  > [extensions]
+  > lfs =
+  > EOF
+#endif
 
   $ . "$TESTDIR/narrow-library.sh"
 
@@ -201,10 +209,17 @@ not also in narrower repo
   (run 'hg update' to get a working copy)
 TODO: this should tell the user that their narrow clone does not have the
 necessary content to be able to push to the target
-  $ hg push ssh://user@dummy/narrow2
+
+TODO: lfs shouldn't abort like this
+  $ hg push ssh://user@dummy/narrow2 || true
   pushing to ssh://user@dummy/narrow2
   searching for changes
   remote: adding changesets
   remote: adding manifests
   remote: adding file changes
   remote: added 1 changesets with 0 changes to 0 files
+  remote: error: pretxnchangegroup.lfs hook raised an exception: data/inside2/f.i at f59b4e021835: no match found (lfs-on !)
+  remote: transaction abort! (lfs-on !)
+  remote: rollback completed (lfs-on !)
+  remote: abort: data/inside2/f.i at f59b4e021835: no match found! (lfs-on !)
+  abort: stream ended unexpectedly (got 0 bytes, expected 4) (lfs-on !)


More information about the Mercurial-devel mailing list