Commit Graph

30 Commits

Author SHA1 Message Date
timeless
998fd9af34 fileset: add hint for list error to use or 2015-12-23 17:54:13 +00:00
Matt Harbison
996ae5279d test-fileset: conditionalize output with symlink 2015-12-21 20:18:06 -05:00
FUJIWARA Katsunori
2cb14bf8f0 fileset: detect unintentional existing() invocation at runtime
A fileset predicate can invoke 'matchctx.existing()' successfully,
even if it isn't marked as "existing caller". It is aborted only in
some corner cases: e.g. there were one deleted file in the working
directory (see 2c5c0790cbcc for detail).

This patch makes 'matchctx.existing()' invocation abort if not
'_existingenabled', which is true only while "existing caller"
running.

After this changes, non-"existing caller" predicate function is
aborted immediately, whenever it invokes 'matchctx.existing()'. This
prevent developer from forgetting to mark a predicate as "existing
caller".

BTW, unintentional 'matchctx.status()' invocation can be detected
easily without any additional trick like this patch, because it
returns 'None' if a predicate isn't marked as "status caller", and
referring field (e.g. '.modified') of it is always aborted.
2015-12-21 22:31:16 +09:00
FUJIWARA Katsunori
655c371178 fileset: treat encoding and eol as the predicate calling _existing
Before this patch, predicate function 'encoding' and 'eol' aren't
listed up in '_existingcallers', even though they invoke 'existing()'.

This causes unexpected failure of these predicate, if there is a
(manually) deleted file in the working directory.

2c5c0790cbcc and 12b403664548 seem to overlook putting already
existing 'encoding' or newly introduced 'eol' into '_existingcallers'.

This patch also changes order of fileset "eol(unix)" output in test,
because "existing caller" predicates show "A(dded)" files before
"C(lean)" ones.
2015-12-21 22:31:16 +09:00
liscju
616740cead fileset: add missing() predicate (issue4925)
Help of status cmd defines status file of 'missing', what is
called in fileset 'deleted'. To stay consistent this patch
introduces missing() predicate which in fact is alias to
'deleted'.
2015-11-18 20:55:32 +01:00
Matt Harbison
4f2a7a6b1a test-fileset: glob the updated file count for Windows stability
Some of the prior changes are platform dependent, involving symlinks, exec bits
and non portable names.  An update 10 lines above also globbed this value to
avoid differences, since this line isn't of particular interest- the filesets
are.
2015-11-09 17:20:50 -05:00
Siddharth Agarwal
a6dc53e738 simplemerge: move conflict warning message to filemerge
The current output for a failed merge with conflict markers looks something like:

  merging foo
  warning: conflicts during merge.
  merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
  merging bar
  warning: conflicts during merge.
  merging bar incomplete! (edit conflicts, then use 'hg resolve --mark')

We're going to change the way merges are done to perform all premerges before
all merges, so that the output above would look like:

  merging foo
  merging bar
  warning: conflicts during merge.
  merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
  warning: conflicts during merge.
  merging bar incomplete! (edit conflicts, then use 'hg resolve --mark')

The 'warning: conflicts during merge' line has no context, so is pretty
confusing.

This patch will change the future output to:

  merging foo
  merging bar
  warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
  warning: conflicts while merging bar! (edit, then use 'hg resolve --mark')

The hint on how to resolve the conflicts makes this a bit unwieldy, but solving
that is tricky because we already hint that people run 'hg resolve' to retry
unresolved merges. The 'hg resolve --mark' mostly applies to conflict marker
based resolution.
2015-10-09 13:54:52 -07:00
Yuya Nishihara
375ffa2a98 fileset: handle error of string unescaping 2015-09-10 23:32:36 +09:00
Anton Shestakov
6a4a921104 filesets: ignore unit case in size() predicate for single value
When specifying one plain value in size(), e.g. size(1k), fileset tries to
guess the upper bound automatically (see the comment in _sizetomax()). It
didn't ignore the specified unit's case, and so size("1 GB"), for example,
produced this error:

hg: parse error: couldn't parse size: 1 GB

Let's do the same thing that util.sizetoint() does: .lower().

The two test lines without output just check that there are no parse errors.
2015-08-08 14:42:27 +08:00
Yuya Nishihara
277b13b7cf test-fileset: remove bashism, use test instead of '[[ ]]'
Debian dash complains about it.

  $TESTTMP.sh: 213: $TESTTMP.sh: [[: not found
2015-06-16 22:47:05 +09:00
Matt Harbison
ff48d6b214 convert: support incremental conversion with hg subrepos
This was implied in issue3486, which specifically asked for subrepo support in
lfconvert.  Now that lfconvert uses the convert extension internally when going
to normal files, the issue is half fixed.  But now even non largefile repos
benefit when other transformations are needed.

Supporting a full subrepo tree conversion from a single command doesn't seem
reasonable, given the number of options that can be provided, and the
transformations that would need to occur when entering a subrepo (consider
'filemap' paths).  Instead, this allows the user to incrementally convert each
hg subrepo from bottom up like so:

  # so convert knows the dest type when it sees a non empty dest dir
  $ hg init converted

  $ hg convert orig/sub1 converted/sub1
  $ hg convert orig/sub2 converted/sub2
  $ hg convert orig converted

This allows different options to be applied to different subrepos more readily.
It assumes the shamap is in the default location in each converted subrepo for
simplicity.  It also allows for a subrepo to be cloned into place, in case _it_
doesn't need a conversion.  I was able to convert away from using
largefiles/bfiles in several subrepos with this mechanism.
2015-05-29 13:25:34 -04:00
Yuya Nishihara
dfdaf0679a fileset: pretty print syntax tree in debug output 2015-04-26 22:26:44 +09:00
Siddharth Agarwal
52e04b718f test-fileset.t: remove 'bar ' and 'baz\' from tested filenames
This test is guarded by a '#if no-windows', but they can't be written out on
vfat on Linux either. con.xml can, and for testing that's good enough.

Also clean up a stray 'ls' that I mistakenly left in while writing the test.
2015-03-22 19:19:16 -07:00
Matt Harbison
2e1bbe621d test-fileset: forget non-portable files to avoid failures on Windows
The 3 deleted lines appeared on Windows, because the files were never created in
the first place.
2015-03-21 01:24:17 -04:00
Siddharth Agarwal
63850f5fd4 fileset: add a fileset for portable filenames
This has mostly the same semantics as the files that the 'ui.portablefilenames'
config option would warn or abort about. The only difference is filenames that
case-fold to the same string -- given a set of filenames we've already
checked we can check whether a new one collides with them, but we don't have a
way to tell which filename it collided with.
2015-03-19 21:26:18 -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
Matt Mackall
704604439e fileset: handle underbar in symbols
This was documented, but not implemented.
2013-07-23 14:18:56 -05:00
Matt Mackall
2ad3a48eb3 filesets: add eol predicate 2013-03-29 16:48:32 -07:00
Patrick Mezard
57f8b328dc fileset: fix generator vs list bug in fast path
$ hg debugfileset 'a or b'

would only return a or b but not both because the base file list was a
generator instead of a replayable sequence.
2012-08-15 22:50:23 +02:00
Patrick Mezard
04200aa71a debugfileset: implement --rev, more tests 2012-08-15 22:28:32 +02:00
Patrick Mezard
9da04ddd86 test-fileset: test remaining predicates
- exec
- symlink
- size
- resolved / unresolved
- subrepo
2012-08-15 22:09:09 +02:00
Patrick Mezard
afc53271b1 fileset: do not traceback on invalid grep pattern 2012-08-15 19:25:45 +02:00
Patrick Mezard
5874c142ff fileset: matchctx.existing() must consider ignored files
When running:

  $ hg debugfileset 'binary() and ignored()'

getfileset() was correctly retrieving ignored files but
matchctx.existing() was not taking them in account. Just add them along
with unknown files.
2012-08-15 22:29:32 +02:00
Patrick Mezard
faab1846cc fileset: matchctx.existing() must consider unknown files
By default, unknown files are ignored. If the 'unknown()' predicate
appears in the syntax tree, then they are taken in account.
Unfortunately, matchctx.existing() was filtering against non-deleted
context files, which does not include unknown files. So:

  $ hg debugfileset 'binary() and unknown()'

would not return existing binary unknown files.
2012-08-15 22:29:09 +02:00
Patrick Mezard
663673858e fileset: exclude deleted files from matchctx.existing()
Running:

  $ hg debugfileset 'binary()'

would traceback if there were one deleted file in the working directory.
It happened because matchctx.existing() was filtering files against the
ctx.__contains__() but deleted files are still considered part of
workingctx.
2012-08-15 21:44:00 +02:00
Patrick Mezard
d331997ea9 test-fileset: test file status predicates 2012-08-15 18:04:50 +02:00
Patrick Mezard
95df23a5ab fileset: actually implement 'minusset'
$ hg debugfileset 'a* - a1'

was tracing back because 'minus' symbol was not supported.
2012-08-15 19:02:04 +02:00
Patrick Mezard
00a746e909 tests: test filesets with test-fileset.t 2012-08-15 17:39:03 +02:00