Commit Graph

12 Commits

Author SHA1 Message Date
Jun Wu
effa0da8de test-helpers: add a helper to run test using chg
Summary:
The helper could be used in individual tests to enable chg if chg exists.
This allows us to have more precise control on what tests to use chg instead
of using a global flag in run-tests.py.

This makes certain tests containing many hg commands much faster. For example,
`test-revset.t` took 99 seconds before:

  % ./run-tests.py test-revset.t --time
  .
  # Ran 1 tests, 0 skipped, 0 failed.
  # Producing time report
  start   end     cuser   csys    real      Test
    0.000  99.990  86.410  12.000  99.990   test-revset.t

And 10 seconds after:

  % ./run-tests.py test-revset.t --time
  .
  # Ran 1 tests, 0 skipped, 0 failed.
  # Producing time report
  start   end     cuser   csys    real      Test
    0.000  10.080   0.380   0.130  10.080   test-revset.t

Also enable it for some other tests. Note the whitelist is not complete.  We
probably want to whitelist more tests in the future.

The feature could be opted out by deleting `contrib/chg/chg`.

Reviewed By: phillco

Differential Revision: D6767036

fbshipit-source-id: 8220cf408aa198d5d8e2ca5127ca60e2070d3444
2018-04-13 21:50:54 -07:00
Phil Cohen
86be3bceed tests: add commit hashes to log commands in rebase tests
Commit hashes are a useful way to ensure the content of commits made in the
tests are not changing, even if we don't query every aspect of every commit.
(And some properties, like extras, are rarely printed at all.)

Many of the rebase log -G calls didn't show hashes; by adding hashes to places
that weren't showing them we can help protect those tests from unwanted
changes.

Differential Revision: https://phab.mercurial-scm.org/D1650
2017-12-10 21:57:37 -08:00
Mads Kiilerich
fcd9a54660 mq: smarter handling of plain headers
93eca2533d2a and 1deb493773a1 fixed issue4453 with a simple insertplainheader
function that fixed the regression but didn't make the implementation more
stable.

Now we introduce plain header handling similar to how we handle hg patches. The
whole header is scanned for fields to update while determining the best
position for inserting the field if it is missing. It also makes sure there is
an empty line between headers and body.
2014-11-28 03:09:06 +01:00
Matt Mackall
cbe34eb85a merge with stable 2014-11-18 12:29:30 -06:00
Mads Kiilerich
3337547e58 mq: when adding headers in plain mode, separate them from message (issue4453)
05acc6157816 did a clean-up in one direction ... but we want it in the other
direction.
2014-11-17 01:48:43 +01:00
Mads Kiilerich
d2e99f9304 mq: when setting message in plain mode, separate it from header (issue4453)
Fix inconsistent handling of plain header separation in mq patcheader - and
contrary to 05acc6157816, do it in the direction of having an empty line
between header and description. Plain patches are like mails and should thus
have an empty line between headers and body in compliance with RFC 822 3.1.
2014-11-16 19:57:40 +01:00
Yuya Nishihara
ed7051c6c7 tests: write hgrc of more than two lines by using shell heredoc
Here document should be readable than repeating echo commands.
2014-11-04 23:41:46 +09:00
Mads Kiilerich
44bd94dc4e mq: refactor patchheader header ordering to match export (BC)
The refactoring also gives more robust and extendable handling of other HG
headers.
2014-09-24 02:41:11 +02:00
Mads Kiilerich
3ed8837146 mq: write headers for new HG patches in the same order as export (BC) 2014-09-20 17:06:56 +02:00
Mads Kiilerich
8c41a3576b mq: correctly make an empty line after description in new patches
There would in some cases be an empty line between headers and the description -
that does not seem right.

There should also be an empty line between description and diff - but that was
missing.

These two mistakes would sometimes make it up for each other so we fix both at
once to just show the improvement.

Instead of writing an extra newline when writing a header line, write an extra
line when it not is written as a part of the description but is necessary
anyway.
2014-09-20 17:06:56 +02:00
Mads Kiilerich
59664fd950 check-code: fix check for trailing whitespace on continued lines too
The tests in test-annotate.t and test-import-git.t that relied on trailing
space in a file created by a here string is now masked by a literal 'EOL'
string that is removed.
2012-08-08 18:10:37 +02:00
Matt Mackall
fab65c3e1b tests: unify test-mq-header-date 2010-09-26 13:43:21 -05:00