This is an archive of the discontinued Mercurial Phabricator instance.

lfutil: provide a hint if the largefiles/lfs cache path cannot be determined
ClosedPublic

Authored by mharbison72 on Feb 24 2020, 5:47 PM.

Details

Summary

A coworker hit this error using an LFS repo in a stripped down environment, and
didn't know how to resolve it.

The final conditional is a bit fast and loose, but there is currently no 'posix'
test in hghave, and it doesn't seem like it's worth adding for this since I
think Windows is the only non-POSIX platform we run tests on.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

mharbison72 created this revision.Feb 24 2020, 5:47 PM

Could we get a test for this? To make sure the hint looks fine and that the error code does not crash ?

Could we get a test for this? To make sure the hint looks fine and that the error code does not crash ?

The reason I didn't add a test (or see any changes to existing ones) is because the config property is baked into the config file generated by run-tests.py, so it never hits this path. But I did test by hand on Windows.

Could we get a test for this? To make sure the hint looks fine and that the error code does not crash ?

The reason I didn't add a test (or see any changes to existing ones) is because the config property is baked into the config file generated by run-tests.py, so it never hits this path. But I did test by hand on Windows.

Could we alter that config in test file to trigger the error in there ?

mharbison72 edited the summary of this revision. (Show Details)Feb 24 2020, 8:20 PM
mharbison72 updated this revision to Diff 20293.
marmoute accepted this revision.Feb 25 2020, 3:46 AM

Thanks for adding the test.

pulkit accepted this revision.Feb 25 2020, 7:19 AM
This revision is now accepted and ready to land.Feb 25 2020, 7:19 AM

test-check-code.t says hi:

--- /home/foobar/repo/pushaccess/tests/test-check-code.t
+++ /home/foobar/repo/pushaccess/tests/test-check-code.t.err
@@ -32,6 +32,16 @@
   Skipping i18n/polib.py it has no-che?k-code (glob)
   Skipping mercurial/statprof.py it has no-che?k-code (glob)
   Skipping tests/badserverext.py it has no-che?k-code (glob)
+  tests/test-lfs-bundle.t:102:
+   >   $ env -u HOME -u LOCALAPPDATA -u APPDATA HGRCPATH= hg config lfs --debug
+   don't use 'env -u VAR', use 'unset VAR'
+  tests/test-lfs-bundle.t:109:
+   >   $ env -u HOME HGRCPATH= hg config lfs --debug
+   don't use 'env -u VAR', use 'unset VAR'
+  tests/test-lfs-bundle.t:116:
+   >   $ env -u XDG_CACHE_HOME -u HOME HGRCPATH= hg config lfs --debug
+   don't use 'env -u VAR', use 'unset VAR'
+  [1]
 
 @commands in debugcommands.py should be in alphabetical order.
 

ERROR: test-check-code.t output changed
pulkit accepted this revision.Feb 26 2020, 4:38 AM