Commit Graph

40 Commits

Author SHA1 Message Date
Matt Harbison
41b0ff8118 largefiles: ignore hidden changesets with 'verify --large --lfa'
Previously, if there were any hidden changesets, the --lfa argument would cause
the command to abort with a hint about using --hidden when it tripped over a
hidden changeset.
2015-06-06 22:10:18 -04:00
Matt Mackall
3ad28905f6 tests: drop explicit $TESTDIR from executables
$TESTDIR is added to the path, so this is superfluous. Also,
inconsistent use of quotes means we might have broken on tests with
paths containing spaces.
2015-06-08 14:44:30 -05:00
Matt Harbison
3ab2bc3f24 largefiles: use the convert extension for 'lfconvert --to-normal'
The logic in the convert extension is more advanced, supporting extra features
like converting revision IDs in 'extras' (e.g. 'amend_source'), supports
updating hashes in commit messages, and outputs an SHA map file.  Rather than
try to duplicate all of that, just use the existing code.

Even though the convert extension supports user supplied options like filemap,
etc, those features aren't available on the lfconvert interface.  Therefore, it
is safe to use the filemap mechanism (in memory) to handle the standin -> file
rename.  The convert extension handles the destination locking for this path.

There was a comment in test-lfconvert.t about the hash on rev 5 being different
because it was doing a better job than "hg remove" + "hg merge" + "hg commit".
It isn't clear to me what was happening or why, but now the hashes match the
original repo exactly after a roundtrip, which seems like a good idea.  If there
really was something beneficial about the previous behavior, perhaps merge can
be changed so that everyone benefits.

Converting to a largefiles repo still uses the original (limited) lfconvert
logic.
2015-05-28 13:34:37 -04:00
Aaron Kushner
c8faef4c5a config: exit non zero on non-existent config option (issue4247)
When running 'hg config no_such_option', hg exited with a
zero exit code. This change now exits with a 1 if the
config option does not exist.
2014-08-19 16:57:02 -07:00
Pierre-Yves David
3efa776f85 resolve: add parenthesis around "no more unresolved files" message
This message may be confused with an error message. Adding parenthesis around it
will make it more recognisable as an informative message.
2014-07-26 03:32:49 +02:00
Matt Mackall
0cb0a7ba67 resolve: simplify "finished" message
The recently introduced message was:

  no unresolved files; you may continue your unfinished operation

This had three problems:

- looks a bit like an error message because it's not saying "we've
  just resolved the last file"
- refers to "unfinished operation", which won't be the case with
  "update" or "merge"
- introduces semicolons to error messages, which is stylistically
  questionable

I've simplified this to:

  no more unresolved files

In the future, if we want to prompt someone to continue a particular operation, we should use
a hint style:

  no more unresolved files
  (use 'hg graft --continue' to finish grafting)
2014-05-09 14:46:50 -05:00
Gregory Szorc
85e363fea8 resolve: print message when no unresolved files remain (issue4214)
When using resolve, users often have to consult with the output of |hg
resolve -l| to see if any unresolved files remain. This step is tedious
and adds overhead to resolving.

This patch will notify a user if there are no unresolved files remaining
after executing |hg resolve|::

    no unresolved files; you may continue your unfinished operation

The patch stops short of telling the user exactly what command should be
executed to continue the unfinished operation. That is because this
information is not currently captured anywhere. This would make a
compelling follow-up feature.
2014-04-18 22:19:25 -07:00
Simon Heimberg
305a187eff tests: lines with largefile .* file://$TESTTMP also match on windows
on windows, largefile paths are written as "file:///C:/temp/...", corresponding
to "file:///$TESTTMP/..." (all three slashes shown).
But on posix systems they are written as "file:///tmp/..." corresponding to
"file://$TESTTMP/..." (only two slashes shown).

Write the glob "file:/*/" to match both versions.
2014-01-27 21:39:25 +01:00
Martin Geisler
7316194bdf tests: don't load unnecessary graphlog extension
Since graphlog is in core, we can use 'hg log -G' instead.
2013-11-22 19:14:17 +01:00
Martin Geisler
505a3bce01 tests: use strip extension instead of mq where it makes sense
When a test only uses 'hg strip', it no longer needs to load MQ.
2013-11-22 17:10:08 +01:00
Mads Kiilerich
63e01aeb0a largefiles: hide passwords in URLs in ui messages 2013-10-17 16:13:15 +08:00
Brendan Cully
5fda2ba23f tests: sprinkle globs over largefiles/subrepo tests for Windows 2013-05-02 11:26:43 -07:00
Mads Kiilerich
208aa05eca largefiles: stat all largefiles in one batch before downloading
This avoids a lot of expensive roundtrips to remote repositories ... but might
be slightly slower for local operations.

This will also change some aborts on missing files to warnings. That will in
some situations make it possible to continue working on a repository with
missing largefiles.
2013-04-15 23:37:43 +02:00
Mads Kiilerich
63d1e576f2 tests: fix windows test failure with largefiles 2013-02-04 23:48:34 +01:00
Mads Kiilerich
293a08a6ab largefiles: report localstore errors with single line warnings messages
The actual hash is also not relevant to report.

This makes verify output with multiple failures easier to process.
2013-02-04 02:46:53 +01:00
Wagner Bruna
30efeaefbe largefiles: enhance error message to make it more i18n-friendly 2013-01-21 13:42:04 -02:00
Benoit Boissinot
8f1400147f largefiles: fix largefiles+subrepo update (issue3752)
Override updaterepo() instead of individual methods that may not be called for
each subrepo. Add test.
Based on patch from Matt Harbison.

Changes the order of update-related messages (now largefiles comes before the
global status).
2013-01-23 00:51:53 +01:00
Mads Kiilerich
26b3c84619 localrepo: store requirements sorted 2012-12-12 02:38:14 +01:00
Mads Kiilerich
6376600846 tests: fix windows test failures 2012-12-28 14:22:24 +01:00
Mads Kiilerich
9302004c43 largefiles: cleanup of warnings on errors getting largefiles
Especially the "no default or default-push path set in hgrc" was often very
misleading and didn't give any hint where it actually was looking.

A long error messages is better than several multi-line messages.
2012-12-13 19:19:06 +01:00
Matt Harbison
eb56660b19 largefiles: don't copy largefiles from working dir to the store while converting
Previously, if one or more largefiles for a repo being converted were not in the
usercache, the convert would abort with a reference to the largefile being
missing (as opposed to the previous patch, where the standin was referenced as
missing).  This is because commitctx() tries to copy all largefiles to the
local store, first from the user cache, and if the file isn't found there, from
the working directory.  No files will exist in the working directory during a
convert, however.  It is not sufficient to force the source repo to be local
before proceeding, because clone and pull do not download largefiles by default.

This is slightly less than ideal because while the conversion will now complete,
it won't be possible to update to revs with missing largefiles unless the user
intervenes manually, because there is no default path pointing back to the
source repo.  Ideally these files would be cached during the conversion.

This check could have been done in reposetup.commitctx() instead, but this
ensures the local store directory is created, which is necessary to enable the
standin matcher.

The rm -> 'rm -f' change in the test is to temporarily suppress an error
clearing the cache- as noted, the cache is is not repopulated during convert.
When that is fixed, this can be changed back and the verification errors will
disappear too.
2012-10-23 21:32:19 -04:00
Matt Harbison
8973167c73 largefiles: respect the rev when reading standins in copytostore() (issue3630)
When the rev isn't specified, the standin for the working copy gets read.  But
convert doesn't update the working copy for each cset it processes, so there is
no standin and the 'hg convert' would abort complaining about the standin being
missing.

Note that if the largefile is not in the user cache, 'hg convert' complains
about the largefile itself missing from the destination repo.
2012-10-23 21:07:14 -04:00
Matt Harbison
7640adfa45 largefiles: always create the cache and standin directories when cloning
The standin matcher only works if the .hglf directory exists (and it won't exist
if 'clone -U' is used, unless --all-largefiles is also specified).  Since not
even 'update -r null' will get rid of the standin directory, this ensures that
the standin directory always exists if the repo has the 'largefiles'
requirement.  This requirement is only set after a largefile is committed, so
these directories will not be created for repos that have the extension enabled
but have not committed a largefile.

With the standin directory in place, 'lfconvert --to-normal' will now be able to
download the required largefiles when converting a repo that was created with
'clone -U', and whose files are not in the usercache.

The downloadlfiles command could probably be put inside the 'largefiles'
requirement conditional too, but given that the user specified --all-largefiles,
there is likely an expectation to print out the number of largefiles downloaded,
even if it is 0.
2012-10-14 15:10:13 -04:00
Matt Harbison
6217120715 largefiles: fix a traceback in lfconvert if a largefile is missing (issue3519)
The largefile may be missing for various reasons, including that a remote
repository was cloned without the --all-largefiles option.  Therefore, it seems
reasonable to attempt to download the missing files and failing that, abort and
indicate the affected file and revision so the user can manually fix the
problem.
2012-10-14 14:44:08 -04:00
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +02:00
Mads Kiilerich
c1d1cd29e9 tests: convert some 'hghave symlink' to #if
This will enable some tests for windows.
2012-06-10 18:50:42 +02:00
Takumi IINO
3b2329f4cd tests: skip test-lfconvert.t if not support symblic link
Windows not support symbolic link. but test-lfconvert.t
execute 'ln -s' command.

@@ -51,8 +51,6 @@
   skipping incorrectly formatted tag IncorrectlyFormattedTag!
   skipping incorrectly formatted id invalidhash
   no mapping for id 0123456789abcdef
-  abort: renamed/copied largefile large3 becomes symlink
-  [255]
   $ cd bigfile-repo
   $ hg strip --no-backup 2
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved

ERROR: test-lfconvert.t output changed
2012-03-29 22:16:56 +09:00
Levi Bard
25e495c812 largefiles: add tests for uncovered codepaths (issue3092)
Add tests for lfconvert codepaths where:
 * largefiles have been both renamed and relinked
 * .hgtags has invalid content
2012-01-08 17:09:01 +01:00
Matt Mackall
3d60dfdd1c merge with stable 2011-11-30 17:15:39 -06:00
FUJIWARA Katsunori
d9039e2664 largefiles: use "ui.configlist()" to get largefiles.patterns configuration
current lfconvert implementation uses combination of "ui.config()" and
"str.split(' ')" to get largefiles.patterns configuration.

but it can not handle multiline configuration in hgrc files correctly.

lfconvert should use "ui.configlist()" instead of it, as same as
override_add does.
2011-11-24 17:54:50 +09:00
Matt Mackall
66de5cde16 merge: give a special message for internal:merge failure (issue3105) 2011-11-16 18:04:19 -06:00
Matt Mackall
a5d3d42e92 tests: use md5sum.py instead of sha1sum, add check 2011-10-31 14:22:11 -05:00
Matt Mackall
4b52621903 tests: fix check-code detection of anchored expressions, fix echo -n usage 2011-10-26 12:56:27 -05:00
Greg Ward
520457ceba largefiles: test "lfconvert --to-normal" with rename/remove/merge
This gets us very close to full test coverage of lfconvert. The only
features not tested are:
- .hgtags conversion
- abort when largefile becomes symlink
2011-10-22 15:39:51 -04:00
Greg Ward
a9c8718766 largefiles: test lfconvert with rename, remove, and merge 2011-10-22 15:16:52 -04:00
Greg Ward
ce40a4d923 largefiles: beef up test-lfconvert.t so it's more thorough
- instead of converting a single changeset with a single file, convert
  two changesets which each add a mix of normal and large files
- make one of the large files not-so-large, but identified as large
  by filename
- use shorter, simpler filenames
- put some files in a subdirectory
- test that file contents are correctly converted
- drop unnecessary cleanup step
2011-10-22 14:52:05 -04:00
Greg Ward
04bcf1ecd1 largefiles: rearrange how lfconvert detects non-local repos
Mainly this is so we can test that code; it has the side benefit of not
requiring network I/O to reject non-local repo URLs.
2011-10-22 14:20:17 -04:00
Greg Ward
8c2e55bcd4 largefiles: test lfconvert error handling; remove redundant code 2011-10-22 14:17:19 -04:00
Greg Ward
48b00ec7da largefiles: extract test-lfconvert.t from test-largefiles.t
test-largefiles.t is getting pretty big, and there's lots more to test
in lfconvert. And lfconvert is a fairly orthogonal feature to the
rest of largefiles.
2011-10-22 13:48:56 -04:00
Mads Kiilerich
8c22a0ec28 tests: make (glob) on windows accept \ instead of /
Globbing is usually used for filenames, so on windows it is reasonable and very
convenient that glob patterns accepts '\' or '/' when the pattern specifies
'/'.
2011-11-07 03:25:10 +01:00