Commit Graph

6376 Commits

Author SHA1 Message Date
Matt Mackall
0bef60f271 run-tests: make vlog a proper function 2013-05-24 14:30:43 -05:00
Matt Mackall
60b62579bb run-tests: unify marks and result codes 2013-05-24 14:30:43 -05:00
Matt Mackall
c97fde7db9 run-tests: change return code of runone 2013-05-24 14:30:35 -05:00
Matt Mackall
9dccd87998 run-tests: regroup some initialization checks 2013-05-24 13:53:56 -05:00
Matt Mackall
fde01215f9 run-tests: fix a path existence check 2013-05-24 13:52:05 -05:00
Matt Mackall
8bd32fc6fa run-tests: regroup some variable initialization 2013-05-24 13:51:20 -05:00
Matt Mackall
037d2bf78a run-tests: regroup nested functions 2013-05-24 13:48:25 -05:00
Matt Mackall
f100d35303 run-tests: regroup temp dir creation 2013-05-24 13:47:17 -05:00
Matt Mackall
2180875dae run-tests: pull hgrc creation out as function 2013-05-24 13:41:20 -05:00
Matt Mackall
027e99d223 tests: simplify handling of unknown test types 2013-05-24 13:34:22 -05:00
Matt Mackall
506ab062fd run-tests: filter out non-tests from default list 2013-05-24 13:31:44 -05:00
Matt Mackall
a7060ace56 run-tests: make a table of test types 2013-05-24 13:23:19 -05:00
Matt Mackall
8448d1f531 run-tests: don't need to test shebang any more 2013-05-24 13:02:00 -05:00
Matt Mackall
ae59675587 merge with stable 2013-05-23 17:52:21 -05:00
Durham Goode
1e38cba77a blackbox: fix recording exit codes (issue3938)
Previously the blackbox wrapped runcommand, but this failed to see the error
codes that were created if an exception occurred. I moved that logging to now
wrap _runcatch, so it can observe and log the actual error code (such as when
a user ctrl+c's during a command).

Updated the tests as well. Tested the change by running all the tests with the
blackbox extension enabled and verifying nothing broke (aside from things that
printed what extensions were enabeld).

The progress tests are affected by calls to time.time() so they needed to be
updated to pass.
2013-05-22 17:31:47 -07:00
Matt Mackall
a4827aaeac tests: backport some glob fixups 2013-05-21 15:29:53 -05:00
Yuya Nishihara
7976fca292 branch: strip whitespace before testing known branch name
Because dirstate._branch() strips leading/trailing spaces from .hg/branch,
"hg branch ' foo '" should abort if branch "foo" exists in another head.

tag command had a similar bug and fixed by 11d102903884.
2013-05-07 23:49:03 +09:00
Matt Mackall
43b6b506f1 tests: quiet strip to avoid commandserver pathsep issue 2013-05-09 15:17:29 -05:00
Matt Mackall
d2d6316f27 tests: fix another Windows path issue 2013-05-09 15:09:36 -05:00
Matt Mackall
fe27efdab6 tests: fix unionrepo path issue on msys (issue3927) 2013-05-09 15:01:11 -05:00
FUJIWARA Katsunori
72d4082125 largefiles: check unknown files with case awareness of the filesystem
Before this patch, largefiles extension checks unknown files in the
working directory always case sensitively.

This causes failure in updating from the revision X consisting of
'.hglf/A' (and "A" implicitly) to the revision Y consisting of 'a'
(not ".hglf/A") on case insensitive filesystem, because "A" in the
working directory is treated as colliding against and different from
'a' on the revision Y.

This patch uses "repo.dirstate.normalize()" to check unknown files
with case awareness of the filesystem.
2013-05-07 05:04:11 +09:00
FUJIWARA Katsunori
1d7c1875df largefiles: check existence of the file with case awareness of the filesystem
Before this patch, largefiles extension always unlinks largefiles
untracked on the target context in merging/updating after updating
working directory.

For example, it is assumed that the revision X consists of ".hglf/A"
(and "A" implicitly) and revision Y consists of "a" (not ".hglf/A").

In the case of updating from X to Y, largefiles extension tries to
unlink "A" after updating "a" in working directory. This causes
unexpected unlinking "a" on the case insensitive filesystem.

This patch checks existence of the file in the working context with
case awareness of the filesystem to prevent from such unexpected
unlinking.

"lfcommands._updatelfile()" also unlinks target file in the case
"largefile is tracked in the target context, but fails to be fetched".

This patch doesn't apply "repo.dirstate.normalize()" in this case,
because it should be already ensured in the manifest merging that
there is no normal file colliding against any largefiles.
2013-05-07 05:04:11 +09:00
Bryan O'Sullivan
c787225d04 revert: ensure that copies and renames are honored (issue3920)
Previously, we restored the states of files, but not the additional
information the dirstate uses to track copies and renames.
2013-05-03 12:40:17 -07:00
Durham Goode
c5a04c46b0 hgignore: fix regression with hgignore directory matches (issue3921)
If a directory matched a regex in hgignore but the files inside the directory
did not match the regex, they would appear as deleted in hg status. This
change fixes them to appear normally in hg status.

Removing the ignore(nf) conditional here is ok because it just means we might
stat more files than we had before. My testing on a large repo shows this
causes no performance regression since the only additional files being stat'd
are the ones that are missing (i.e. status=!), which are generally rare.
2013-05-03 09:44:50 -07:00
Brendan Cully
5fda2ba23f tests: sprinkle globs over largefiles/subrepo tests for Windows 2013-05-02 11:26:43 -07:00
Brendan Cully
09d28ec44c tests: skip permissions tests in test-phases-exchange when fs lacks permissions 2013-05-02 11:17:18 -07:00
Sean Farley
a7c7655a58 bookmarks: fix bug that activated a bookmark even with -r passed
If the current revision was the target revision of -r, then the bookmark would
be active. Test cases have been updated accordingly.
2013-05-01 15:24:21 -05:00
Sean Farley
a1b3b895c9 bookmarks: resolve divergent bookmark when moving across a branch
This patch resolves a single divergent bookmark if a divergent bookmark exists
in the target revision and it current bookmark is not an ancestor of the target
revision, else it would already be handled by the previous patch in this
series.

Test coverage is added.
2013-04-30 21:12:49 -05:00
Sean Farley
3561df94aa bookmarks: resolve divergent bookmarks when moving active bookmark forward
This patch resolves divergent bookmarks between the current active bookmark
MARK and the new destination. This situation can arise when pulling new
changesets, abandoning your current changesets actively bookmarked with MARK
via strip, and then doing a bare update. The non-divergent but active bookmark
MARK is then moved to a common ancestor of the new changesets and the abandoned
changesets.

Test coverage is added.
2013-05-01 15:34:45 -05:00
Sean Farley
b0f6662132 bookmarks: resolve divergent bookmarks when fowarding bookmark to descendant
This patch is a follow-up to 00b2764d68e4 that resolves divergent bookmarks
between the to-be-forwarded bookmark MARK and the new descendant. This
situation can happen when pulling new changesets, updating to the divergent
bookmark, abandoning the previous changesets with strip, and then moving MARK
to MARK@N.

Test coverage is added.
2013-05-01 15:31:39 -05:00
FUJIWARA Katsunori
dd7c92f3d8 tags: update tag type only if tag node is updated (issue3911)
Before this patch, tag type information is always updated, even if tag
previously read in has higher priority than one newly read in.

This causes that the tag type is displayed as "local", even if global
tag overwrites existing local one successfully.

This patch updates tag type only if tag node is updated.

This patch tests overwriting local tags below:

  - visible one (normal case)
  - already removed one (recorded as null)
2013-04-30 09:02:02 +09:00
Mads Kiilerich
2fc7d0133f match: fix root calculation for combining regexps with simple paths
The fall-back root for walking is the repo root, not no root.

The "roots" do however also end up in m.files() which is used in various ways,
for instance to indicate whether matches are exact. The change could thus have
other impacts.
2013-04-30 01:04:35 +02:00
FUJIWARA Katsunori
693a1ef129 icasefs: enhance test to prevent regression by changes in the future
This patch adds steps to test case-folding collision detection on the
revision tree built up in the order different from the one reproducing
issue3452.

This may prevent regression by changes around "copy detection" and/or
"case-folding collision detection" logic in the future.
2013-04-30 05:01:32 +09:00
FUJIWARA Katsunori
baa57a476c icasefs: rewrite case-folding collision detection (issue3452)
Before this patch, case-folding collision detection uses
"copies.pathcopies()" before "manifestmerge()", and is not aware of
renaming in some cases.

For example, in the case of issue3452, "copies.pathcopies()" can't
detect renaming, if the file is renamed at the revision before common
ancestor of merging. So, "hg merge" is aborted unexpectedly on case
insensitive filesystem.

This patch fully rewrites case-folding collision detection, and
relocate it into "manifestmerge()".

New implementation uses list of actions held in "actions" and
"prompts" to build provisional merged manifest up.

Provisional merged manifest should be correct, if actions required to
build merge result up in working directory are listed up in "actions"
and "prompts" correctly.

This patch checks case-folding collision still before prompting for
merge, to avoid aborting after some interactions with users. So, this
assumes that user would choose not "deleted" but "changed".

This patch also changes existing abort message, because sorting before
collision detection changes order of checked files.
2013-04-30 05:01:32 +09:00
FUJIWARA Katsunori
bc5d48aa84 icasefs: refactor "test-casecollision-merge.t" to reuse in succeeding fixes
This patch refactors "test-casecollision-merge.t" to increase
reusability in succeeding patches.

It is confirmed that changed test also can detect issue3370.
2013-04-30 05:01:32 +09:00
Bryan O'Sullivan
6ad1b7d190 dispatch: add doctests for _earlygetopt 2013-04-29 14:14:41 -07:00
Pierre-Yves David
9be8b6a846 push: make locking of source optional (issue3684)
Having the permission to lock the source repo on push is now optional. When the
repo cannot be locked, phase are not changed locally. A status message is issue
when some actual phase movement are skipped:

    cannot lock source repo, skipping local public phase update

A debug message with the exact reason of the locking failure is issued in all
case.
2013-04-30 21:19:56 +02:00
FUJIWARA Katsunori
37ccfcc8ea merge: increase safety of parallel updating/removing on icasefs
"merge.applyupdates()" sorts "actions" in removal first order, and
"workeractions" derived from it should be also sorted.

If each actions in "workeractions" are executed in serial, this
sorting ensures that merging/updating process is collision free,
because updating the file in target context is always executed after
removing the existing file which causes case-folding collision against
the former.

In the other hand, if each actions are executed in parallel, updating
on a worker process may be executed before removing on another worker
process, because "worker.partition()" partitions list of actions
regardless of type of each actions.

This patch divides "workeractions" into removing and updating, and
executes the former first.

This patch still scans "actions"/"workeractions" some times for ease
of patch review, even though large list may cost much in this way.
(total cost should be as same as before)

This also changes some tests, because dividing "workeractions" affects
progress indication.
2013-04-29 15:58:15 +09:00
Pierre-Yves David
e23948d63d hgweb: handle filtered "0" rev in navigation
Before this changeset, navigation generation crashed if revision "0" was
filtered. We introduce a `_first` methods on revision navigation that return the
lowest unfiltered element and use it in two place were the "0" changeset was
explicitly referenced.

Test case are introduced.
2013-04-30 13:53:49 +02:00
Pierre-Yves David
f362d20bef hgweb: fix empty navigation detection
For some obscure reason, changelog.node(0) returns nullid if changelog is empty.
this break empty navigation detection. We fix this code by using the length of
the changelog.

Using the length have some issue with revision filtering but this is a small
step in the right direction. Proper fix comes in later changeset.
2013-04-30 15:11:12 +02:00
Jim Hague
3d040369cd tests: AIX can't handle negative date in test-dirstate.t
test-dirstate.t fails on AIX in the absurd date test. AIX touch errors on
any date prior to 1970. AIX mktime() gives an error on such dates, so the
problem is deeper than touch and attempts to work around touch in Python
failed.

Give up. Add an AIX test to hghave and skip the absurd date test on AIX.
2013-04-30 14:56:33 +01:00
Siddharth Agarwal
bad1c384d8 test-mq-strip.t: add a test for strip --keep with clean working dir
This helped uncover a bug in a patchset I've been writing.
2013-04-26 22:07:25 -07:00
Mads Kiilerich
2f9545c92c largefiles: drop repo wrapping detection
After 08202d1ef738 I see:

  $ hg id -q
  largefiles: repo method 'commit' appears to have already been wrapped by another extension: largefiles may behave incorrectly
  largefiles: repo method 'push' appears to have already been wrapped by another extension: largefiles may behave incorrectly
  3bd0c95ec1bf

The warning is bad:

* The message gives no hint what the problem is and how it can be resolved.
  The message is useless.

* Largefiles do have its share of problems, but I don't think I ever have seen
  a problem where this warning would have helped. The 'may' in the warning
  seems like an exaggeration of the risk. Having largefiles enabled in
  combination with for instance mq, hggit and hgsubversion causes a warning
  (depending on the configuration order) but do not cause problems. Extensions
  might of course be incompatible, but they can be that in many other ways.
  The check and the message are incorrect.

It would thus be better to remove the check and the warning completely.

Before 08202d1ef738 the check always failed. That change made the check work
more like intended ... but the intention was wrong. This change will thus also
back that change out.
2013-04-26 19:04:01 +02:00
FUJIWARA Katsunori
a48794b349 config: discard "%unset" values defined in the other files read in previously
Before this patch, "%unset" can't unset values defined in the other
files read in previously, even though online help document says that
it can. It can unset only values defined in the same configuration
file.

For example, the value defined in "~/.hgrc" can't be unset by "%unset"
in ".hg/hgrc" of the repository.

This patch records "%unset"-ed values in "config.parse()", and
discards corresponding values in "config.update()".
2013-04-26 23:36:12 +09:00
FUJIWARA Katsunori
039fe3e215 tests: rename from test-config-case.t to test-config.t for centralization
Before this patch, there is no test script testing configuration
handling generally. "test-config-case.t" seems to be specific for
testing case sensitive configuration.

This patch renames from "test-config-case.t" to "test-config.t" for
centralization of tests around configuration handling.
2013-04-26 23:16:25 +09:00
Kevin Bullock
ed0cfa5cc4 tests: make sed usage in test-unionrepo.t cross-platform
Usage of the 'i' command proves tricky. I tried to write a check-code rule, but
failed.
2013-04-23 17:26:00 -05:00
Durham Goode
0755816b12 blackbox: don't run permission tests on non-unix systems
The windows and vfat test runs were failing due to read/write permissions not
working the same on those systems.  On vfat, permissions can't be changed
at all, and on windows it seems the chmod emulation doesn't remove read
permissions.  We could theoretically get the 'cannot write to blacklog.log'
test to pass on windows but there's no #if condition to let us exclude vfat
only.

Verified that test-blackbox passes on windows now.
2013-04-22 18:00:59 -07:00
Kevin Bullock
2f2218183e check-code: expand sed rule to include more offenders
Expands the rule added in a3f00ef2b622 to include cases where the
address is a line number instead of a regular expression, and fixes an
instance of this pattern in test-unionrepo.t.
2013-04-22 16:50:08 -05:00
Kevin Bullock
5747742d25 check-code: add a rule against a GNU sed-ism
BSD sed requires the 'i' command to be followed with a backslash and a
newline, like so:

  $ sed -e '/^@/i\
  > other'

We've encountered this problem before, e.g. in test-mq.t (215a8789129e).
This change adds a check-code rule and fixes two instances of the
problem in test-record.t.
2013-04-22 16:33:28 -05:00
Alexander Plavin
fb005d78d7 hgweb: make help verbose again (issue3899)
Due to regression introduced in 5fc7d589c700, help in hgweb
was rendered in non-verbose form (issue3899)
2013-04-22 12:27:56 +04:00