Commit Graph

41 Commits

Author SHA1 Message Date
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
d94d866bcb tests: add missing accept of native pathname separator 2012-04-28 01:55:39 +02:00
Thomas Arendsen Hein
a076708e7b merge with stable 2012-04-03 21:02:00 +02:00
Thomas Arendsen Hein
21bb7c4cdc tests: make tests work if directory contains special characters
With this quoting tests will work e.g. in "/tmp/foo bar/mercurial/".
2012-04-03 19:06:35 +02:00
FUJIWARA Katsunori
1b096f8579 forget: show warning messages for forgetting in subrepo correctly
in 'cmdutil.forget()':

   for f in match.files():
       if match.exact(f) or not explicitonly:
           ....

is equal to:

   for f in match.files():
       if True:
           ....

because 'f' from 'match.files()' should 'match.exact(f)':

    - 'match.files()' returns 'self._files'
    - 'match.exact(f)' examines 'f in self._fmap',
    - 'self._fmap' of match is 'set(self._files)'

then, 'explicitonly' wants to suppress warning messges, if it is true
(= 'cmdutil.forget()' is invoked from 'subrepo.forget()').

so, current code should be fixed as:

    if not explicitonly:
        for f in match.files():
           ....
2012-02-06 14:37:49 +09:00
Matt Mackall
6715adc25e merge with stable 2012-02-06 15:22:43 -06:00
Matt Mackall
a17b10a14b subrepo: rewrite handling of subrepo state at commit (issue2403)
When the contents of .hgsubstate are stale (either because they've
manually been tweaked or partial updates have confused it), we get
confused about whether it actually needs committing.

So instead, we actively consult the parent's substate and compare it
the actual current state when deciding whether it needs committing.

Side effect: lots of "committing subrepo" messages that didn't
correspond with real commits disappear.

This change is fairly invasive for a fairly obscure condition, so it's
kept on the default branch.
2012-02-06 15:10:01 -06:00
David M. Carr
560a2fff89 forget: fix subrepo recursion for explicit path handling
When support for handling explicit paths in subrepos was added to the forget
command (155b89136ae7), subrepo recursion wasn't taken into account.  This
change fixes that by pulling the majority of the logic of commands.forget into
cmdutil.forget, which can then be called from both there and subrepo.forget.
2012-01-17 19:10:59 -05:00
David M. Carr
375e0ca3cf add: fix subrepo recursion for explicit path handling
When support for handling explicit paths in subrepos was added to the add
command (825c4cefde4b), subrepo recursion wasn't taken into account.  This
change adds an explicitonly argument to cmdutil.add to allow controlling which
levels of recursion should include only explicit paths versus all matched
paths.
2012-01-17 19:10:58 -05:00
David M. Carr
d83135c3ee tests: add subrepo recursion tests for add/forget with explicit paths
When support for handling add/forget of explicit paths within subrepos was
added (825c4cefde4b/155b89136ae7), nested subrepos weren't handled properly.
This change adds test coverage to expose the broken behavior, which will be
fixed in later patches.
2012-01-17 19:10:54 -05:00
Mads Kiilerich
9c95d62a3d tests: add missing '(glob)'s to match '\' in paths in test output on windows 2011-11-16 03:45:14 +01: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
Martin Geisler
acfa971cf1 subrepos: abort commit by default if a subrepo is dirty (BC)
This changeset flips the default value of ui.commitsubrepos setting
from True to False and adds a --subrepos flag to commit.

The commit, status, and diff commands behave like this with regard to
recusion and the ui.commitsubrepos setting:

          | recurses      | recurses
          | by default    | with --subrepos
  --------+---------------+----------------
  commit: | commitsubrepo | True
  status: | False         | True
  diff:   | False         | True

By changing the default from True to False, the table becomes
consistent in the two columns:

* without --subrepos on the command line, commit will abort if a
  subrepo is dirty and status/diff wont show changes inside subrepos.

* with --subrepos, all three commands will recurse.

A --subrepos flag on the command line overrides the config settin.g
2011-10-21 00:33:08 +02:00
Martin Geisler
c49aaff90e subrepo: abort in hgsubrepo._get if the destination is obstructed
Before, we deleted foo when we determined that there were zero
changesets in the foo subrepo. Any files in foo was deleted too. We
now delete foo/.hg instead, and the normal checks in hg.clone will
then abort if there are untracked files in foo.
2011-10-17 18:01:38 +02:00
Martin Geisler
ebc547d4c7 subrepo: pull revisions on demand when archiving hg subrepos
Before, running 'hg archive -S' could result in

 abort: unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'!

if a subrepo was missing completely or had missing changesets. Now,
the missing changesets will be pulled or cloned as appropriate.

This make Mercurial subrepos match Git subrepos which already took
care to fetch any missing commits before starting the archive.
2011-10-17 16:45:19 +02:00
Martin Geisler
efe9b04aef subrepo: create subrepos using clone instead of pull
Subrepositories used to be created empty and then filled with data
using pull. This is wasteful when you do a clone from a local source
since it means that no hardlinks are created for the subrepos.

This patch make the hgsubrepo._get method check for an empty subrepo
and in that case do a clone instead of a pull. This brings in the same
data as before, but creates hardlinks when possible.
2011-05-09 17:15:44 +02:00
Martin Geisler
6090144a5b merge with stable 2011-02-04 09:17:07 +01:00
trbs
2b860c833d subrepo: fix pruning of subrepo filenames in dirstate (issue2619) 2011-02-04 09:05:23 +01:00
Augie Fackler
5de2d97578 progress using tests: disable time estimates to avoid flakiness 2010-12-15 10:55:14 -06:00
Martin Geisler
290569c6d1 subrepo: add progress bar support to archive 2010-11-29 16:34:10 +01:00
Mads Kiilerich
3174ff376b tests: remove redundant globs
Many globs now just match $TESTTMP and is no longer needed.
2010-10-08 22:36:10 -05:00
Erik Zielke
4217887b02 test-subrepo-recursion: remove empty defaults section 2010-09-30 13:38:21 +02:00
Erik Zielke
5709d44003 test-subrepo-recursion: deleted default arguments
Deleted default arguments from test-sub-repo-recursion. Rationale is
that it is confusing to read, when the arguments aren't at each
command in the test
2010-09-28 13:09:22 +02:00
Erik Zielke
512d0992fc tests: removed test names in tests
The name of the test files is replaced with a glob * expression,
thereby the tests does not depend on the filename of the file they are
in.
2010-09-30 09:49:40 +02:00
Wagner Bruna
141644d96f subrepo: improve lookup error messages 2010-09-13 10:33:49 -03:00
Erik Zielke
ddbd88fdcf incoming/outgoing: Fix recursion on sub repositories
Incoming and outgoing are fixed so they go through the whole three of
repositories instead of only visiting first level of sub repositories.
2010-09-24 12:00:55 +02:00
Brodie Rao
b5fe0d906e tests: add glob matching for unified tests
This adds a " (glob)" marker that works like a simpler version of
(re): "*" is converted to ".*", and "?" is converted to ".".

Both special characters can be escaped using "\", and the backslash
itself can be escaped as well.

Other glob-style syntax, like "**", "[chars]", or "[!chars]", isn't
supported.
2010-09-22 16:06:02 -05:00
Brodie Rao
7d7d96bd74 tests: require regexes in unified tests to be marked with " (re)"
Consider this test:

  $ hg glog --template '{rev}:{node|short} "{desc}"\n'
  @  2:20c4f79fd7ac "3"
  |
  | o  1:38f24201dcab "2"
  |/
  o  0:2a18120dc1c9 "1"

Because each line beginning with "|" can be compiled as a regular
expression (equivalent to ".*|"), they will match any output.

Similarly:

  $ echo foo


The blank output line can be compiled as a regular expression and will
also match any output.

With this patch, none of the above output lines will be matched as
regular expressions. A line must end in " (re)" in order to be matched
as one.

Lines are still matched literally first, so the following will pass:

  $ echo 'foo (re)'
  foo (re)
2010-09-22 16:06:00 -05:00
Brodie Rao
3ed54dfa3d tests: improve regexes in unified tests 2010-09-22 16:05:58 -05:00
Matt Mackall
ac660e9f65 tests: cleanup exit code handling in unified tests 2010-09-21 16:00:02 -05:00
Patrick Mezard
b416e95b1a test-subrepo-recursion: sort archive output for portability 2010-09-21 23:58:32 +02:00
Matt Mackall
89bcf054c9 tests: fixup tests using unzip -l 2010-09-20 15:50:36 -05:00
Martin Geisler
34af0cf109 subrepo: add support for 'hg archive' 2010-09-20 15:46:17 +02:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Martin Geisler
2fe1ef135d test-subrepo-recursion: test missing subrepo 2010-09-13 15:13:30 +02:00
Martin Geisler
d37ba034d5 incoming: recurse into subrepositories with --subrepos/-S flag
As with push and outgoing, the optional source path is ignored for the
subrepositories. Fixing this is Issue1852.
2010-09-13 13:09:31 +02:00
Martin Geisler
2346ea8e9e outgoing: recurse into subrepositories with --subrepos/-S flag
As with push, the optional destination path is ignored for the
subrepositories, i.e., they are always compared with their default
push path. Fixing this is Issue1852.
2010-09-13 13:09:26 +02:00
Martin Geisler
cb93a10b9b add: recurse into subrepositories with --subrepos/-S flag 2010-09-13 13:09:20 +02:00
Martin Geisler
5cb4b1f5eb subrepos: handle modified but uncommitted .hgsub 2010-09-07 16:23:55 +02:00
Martin Geisler
e9c2a20771 diff: recurse into subrepositories with --subrepos/-S flag 2010-09-03 12:58:51 +02:00
Martin Geisler
f2188b5b90 status: recurse into subrepositories with --subrepos/-S flag 2010-09-03 12:58:51 +02:00