Commit Graph

19174 Commits

Author SHA1 Message Date
simon@laptop-tosh
ce4ccac760 tests: check-code more python files without py extension
files found by running
  $ hg manifest | grep -v "\." | xargs file | grep python
2013-06-13 01:44:02 +02:00
Augie Fackler
9460b542a9 dummyssh: fix check-code nit 2013-06-14 15:28:40 -04:00
simon@laptop-tosh
e5622bbc0e run-tests: sort missing files first instead of raising an error
sort first for early telling typos in test names
2013-06-11 23:39:48 +02:00
Durham Goode
539b1f606b filectx: remove dependencies on filerev
Removing dependencies on filectx.filerev() makes it easier to create a filelog
implementation that doesn't have rev numbers.
2013-05-30 19:29:21 -07:00
simon@laptop-tosh
c8aaab9ec9 hg: move return statement after finally block
return is always run after finally block. Now we have same functionality,
but clearer readability.
2013-06-08 22:37:08 +02:00
simon@laptop-tosh
975f5dea4c run-tests: call Threads constructor with keyword arguments
This is suggested in the python documentation
(on http://docs.python.org/2/library/threading.html#thread-objects)
2013-06-09 16:49:08 +02:00
simon@laptop-tosh
400b5ef2b9 run-tests: ignoring tests works again
running with --retest did not work anymore because runone still returned None
for this case. But this is not allowed since a204317f039b.
2013-06-09 16:42:55 +02:00
Simon Heimberg
bfbc27c057 check-code: introduce function for using re2 when available
Do it similar as in mercurial.util. For simplicity only support flag
multiline which is the only one used.
2013-06-08 20:20:14 +02:00
Simon Heimberg
11469e2f90 check-code: compile filters when loading 2013-06-08 20:20:14 +02:00
Simon Heimberg
1f8c40a6d5 check-code: compile all patterns on initialisation
They where compiled once for every checked file (when calling finditer).
2013-06-08 20:20:14 +02:00
Simon Heimberg
5fb5cb59f5 check-code: only fix patterns once
The patterns were fixed once for every file. Now only do it once when loading
the file.
2013-06-08 20:20:14 +02:00
Matt Mackall
1035a87704 merge with stable 2013-06-07 16:59:59 -05:00
Matt Mackall
2a02cc28af run-tests: simplify interrupted message 2013-06-07 16:04:11 -05:00
Matt Mackall
df0aab998a run-tests: remove spurious disable of --time with --debug 2013-06-07 15:58:14 -05:00
Matt Mackall
5a359facfe run-tests: always gather runtimes 2013-06-07 15:56:16 -05:00
Simon Heimberg
cbe95e49e5 run-tests: when interrupted report time in failure message
When --time is specified, the interruption message of an interrupted test is
extended with the time the test has run

INTERRUPTED: /path/to/tests/test-example.t (after 513 seconds)
2013-06-05 22:05:29 +02:00
Simon Heimberg
3d444f656b run-tests: report interrupted tests
When the test run is aborted, a message is printed for each interrupted test.
This is helpful when a test is hanging.

example failure message:
INTERRUPTED: /path/to/tests/test-example.t

The message can appear before or after the line with the number of tests
2013-06-05 22:05:02 +02:00
Simon Heimberg
43548443c6 run-tests: open hgrc file only for writing
The file is not read here. Opening with "w+" is unnecessary.
2013-06-05 22:42:43 +02:00
Simon Heimberg
a9f4d5238f color: use pythons isinstance method instead of reprogramming it 2013-06-05 22:06:16 +02:00
Simon Heimberg
ece17e9392 color: only provide the required opt to _modesetup 2013-06-05 22:06:02 +02:00
Matt Mackall
bf221e220d run-tests: make --noskips work 2013-06-06 14:40:26 -05:00
Durham Goode
1142072e5b filelog: switch 'not len(filerevlog)' to 'not filerevlog'
A few places in the code use 'if not len(revlog)' to check if the revlog
exists. Replacing this with 'not filerevlog' allows alternative revlog
implementations to override __nonzero__ to handle this case without
implementing __len__.
2013-05-30 18:47:16 -07:00
Durham Goode
94d98a2fbb annotate: simplify annotate parent function
The annotate algorithm used a custom parents() function to try to reuse
filectx and filelogs. I simplified it a bit to rely more heavily on the
self.parents() which makes it work well with alternative filectx
implementations. I tested performance on a file with 5000+ revisions
but no renames, and on a file with 500 revisions repeating a series of
4 edits+renames and saw zero performance hit.  In fact, it was reliably a
couple milliseconds faster now.

Added the perfannotate command to contrib/perf.py for future use.
2013-05-30 19:29:03 -07:00
Durham Goode
779523532d changegroup: move changegroup file adding to a separate function
Moving the logic that adds files to a changegroup to a different function
allows extensions to override it and customize the way filelogs are added
to changegroups.

No logic is changed.
2013-05-30 19:26:56 -07:00
Durham Goode
6733c33949 log: move log file walk to its own function
This moves the logic that determines which changesets to process during a
'hg log foo.txt' command. Putting it in its own function allows extensions
to modify how the file log is traversed. For instance, the current
implementation uses filelog revs heavily. Other implementations may not have
filelog revs available.

The function throws an exception if the traversal is not possible via the
filelog, so the parent function can do things the slow way if necessary
(by walking the entire commit history).

Aside from the exception throwing, no logic is changed.
2013-05-30 19:25:55 -07:00
Durham Goode
045d614415 bundle: refactor changegroup prune to be its own function
Moving the prune function to be a non-nested function allows extensions to
control which revisions are allowed in the changegroup. For example, in my
shallow repo extension I want to prevent filelogs from being added to the
bundle.

This also allows an extension to use a filelog implementation that doesn't
have revlog.linkrev implemented.
2013-05-30 17:51:13 -07:00
Durham Goode
bbcab6cdef filectx: refactor filectx.rev() to use filectx._changeid
The code in filectx.rev() was identical to filectx._changeid. Fixing this
allows alternative filectx implementations to only override _changeid.
2013-05-30 17:49:37 -07:00
Bryan O'Sullivan
101b24f17b util: add an optional timestamp parameter to makedate
This will be used by the upcoming shelve extension.
2013-06-03 17:20:45 -07:00
Bryan O'Sullivan
4143ebfdee util: rename ct variable in makedate to timestamp 2013-06-03 17:20:44 -07:00
Bryan O'Sullivan
16cdb3e1a8 merge: add a files method to the mergestate class
This will be used in the upcoming shelve extension.
2013-06-03 17:20:37 -07:00
Matt Mackall
4ee271c45d run-tests: add --loop support
This makes it easy to run tests repeatedly at high loads to look for test failures.
2013-06-02 18:09:06 -05:00
Matt Mackall
177f6f2cb0 run-tests: --interactive and --jobs no longer conflict 2013-06-02 17:58:51 -05:00
Matt Mackall
c5fd75f600 run-tests: sort certain slow tests earlier by keyword
There are a few tests that evade the size heuristic
2013-06-02 17:58:49 -05:00
Matt Mackall
8481b7ff76 run-tests: drop unused resultslock 2013-06-02 17:57:37 -05:00
Matt Mackall
438cc52b80 run-tests: drop options.child and users 2013-06-02 17:57:36 -05:00
Matt Mackall
66a2eb9cb9 run-tests: remove runchildren, now unused 2013-06-02 17:56:53 -05:00
Matt Mackall
9f730ea353 run-tests: schedule largest tests first 2013-06-02 17:56:51 -05:00
Matt Mackall
3a93b9c7d3 run-tests: introduce thread scheduler 2013-06-02 16:58:22 -05:00
Matt Mackall
532173d915 run-tests: use count to calculate port to use
This will keep threads from using the same server ports
2013-06-02 16:55:19 -05:00
Matt Mackall
8fbe5c7e8f run-tests: introduce threadtmp directory 2013-06-02 16:38:15 -05:00
Matt Mackall
c9da438759 run-tests: add abort flag
This will be used to help threads clean up gracefully
2013-06-02 16:29:35 -05:00
Matt Mackall
cc7f14311d run-tests: move more variables to env 2013-06-02 16:29:22 -05:00
Matt Mackall
fc271a759c run-tests: simplify env deletion 2013-06-02 16:29:20 -05:00
Matt Mackall
488a78e3ca run-tests: move most of remaining environment tweaks 2013-06-02 16:22:51 -05:00
Matt Mackall
95e4c8b6bf run-tests: move environment creation to a separate function 2013-06-02 16:22:51 -05:00
Matt Mackall
19ab24f165 run-tests: move HGRCPATH to env 2013-06-02 16:22:51 -05:00
Matt Mackall
5fc51a32ce run-tests: move DAEMON_PIDS to env 2013-06-02 16:22:51 -05:00
Matt Mackall
8c77edfd66 run-tests: move HGPORT setting to env 2013-06-02 16:22:34 -05:00
Matt Mackall
f3e5fe5277 run-tests: write tmp paths into env copy 2013-06-02 15:33:41 -05:00
Matt Mackall
b04bb890c7 tests: avoid writing files to HGTMP 2013-06-02 15:27:08 -05:00