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
Mads Kiilerich
84f1b9864b convert: fix Python syntax in 'splice in' message
Instead of reporting
  spliced in ['82544090e14fe18091e04f1fb0f0d7991cbe6e7e'] as parents of 369fd983d9e13330e9f12d9fce820deae84ea223
report
  spliced in 82544090e14fe18091e04f1fb0f0d7991cbe6e7e as parents of 369fd983d9e13330e9f12d9fce820deae84ea223
2015-10-19 16:49:54 +02:00
Martin Geisler
7316194bdf tests: don't load unnecessary graphlog extension
Since graphlog is in core, we can use 'hg log -G' instead.
2013-11-22 19:14:17 +01:00
Ben Goswami
8afeeb7248 splicemap: improve error handling when source is hg (issue2084)
1. Introduced 2 levels of error handling for splicemap files
   a. Check the splicemap file for rules which are same across different
      types of source repos.  This is done through enhancing parsesplicemap
      function
   b. Check revision string formats.  Each repo may have their own format.
      This is done usign checkrevformat function
   c. Implemented the above two for hg
2013-04-25 11:50:26 -07:00
Mads Kiilerich
9571ceabc0 tests: fix bashism in test-convert-splicemap.t
This should have been caught by check-code.
2012-04-23 01:39:26 +02:00
Patrick Mezard
a8beff44c2 convert: ignore blank lines in mapfiles (issue3286) 2012-02-28 10:06:35 +01:00
Wagner Bruna
526cb26c72 convert: fix typos in error messages 2012-02-24 19:11:35 -02:00
Patrick Mezard
d410481c55 convert: tolerate spaces between splicemap parent ids (issue3203)
Splicemap lines are documented in hg help convert like:

  key parent1, parent2

but parsed like:

  key, parents = line.strip().rsplit(' ', 1)
  parents = parents.replace(',', ' ').split()

The rsplit() call was introduced to handle spaces in keys for the generic
mapfile format. Spaces can appear in svn identifiers since they contain path
components. This logic makes less sense with splicemap since svn identifiers
can also appear on the right side, even if it is a bit less likely. Given the
parsing is theorically broken, I would rather follow what is documented already
and is correct in the main case where all identifiers are hg hashes. Also,
using svn identifiers in a splicemap sounds difficult as they are not easily
accessible.
2012-02-15 11:21:24 +01:00
Patrick Mezard
4fbe13b66c convert: use splicemap entries when sorting revisions (issue1748)
When sorting revisions before converting them, we have to edit the revision
graph using splicemap entries. Otherwise, a spliced revision may be converted
before its synthetic parents. Invalid splicemap revisions are now detected
before starting the conversion.
2012-02-10 22:34:13 +01:00
Patrick Mezard
a92c89fcd0 convert: turn splicemap into a simple dictionary
Parsing the splicemap as a mapfile was a pain because map does not let us
override its parsing code and splicemap entries are not key/values. Besides we
had no need for mapfiles extra features. Just parse the splicemap and return a
dictionary.
2012-02-10 22:25:49 +01:00
Wagner Bruna
307a2fdf03 convert: tolerate trailing spaces on map files
A convert run with a branchmap made with

echo default namedbranch > branchmap

on Windows fails silently and surprisingly; it actually
adds a space after 'namedbranch', so it ends up mapping
"default namedbranch" to "".

This also affects splicemaps, since the same parser is used
for both.
2011-12-02 21:38:57 -02:00
Matt Mackall
4a721be0fe tests: unify test-convert-splicemap 2010-09-26 17:17:19 -05:00