Commit Graph

13 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
274ba69e53 convert: keep converted hg parents that are outside convert.hg.revs (BC)
Before, when converting revisions without also including their already
converted parents in convert.hg.revs, the parents would no longer be parents.

That seems unfortunate and we dare to assume that nobody ever wants that.

Instead, preserve parents that are outside the current convert range but
already have been converted.

The parents returned in getcommit() are unconditionally converted, so we
introduce a separate optparents with optional parents.
2016-04-13 00:16:21 +02:00
Mads Kiilerich
baa3481392 tests: coverage of ancestry with convert in multiple non-overlapping steps
This exposes that parent information is lost in cases where it is possible to
preserve it - and where it thus would make sense if that was what happened.
2016-03-24 16:01:07 -07:00
Durham Goode
a3e74a7ca5 convert: remove restriction on multiple --rev in hg source
Multiple --rev args on convert is a new feature, and was initially disabled for
all sources. It has since been enabled on git sources, and this patch enables it
on mercurial sources.
2015-09-03 10:29:42 -07: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
Mads Kiilerich
1692899d8d convert: introduce hg.revs to replace hg.startrev and --rev with a revset
The existing knobs for controlling which revisions to convert were often
insufficient. Revsets is a shiny hammer that provides a better solution.

Revsets has been introduced in --rev handling in a lot of other places while
being more or less backwards compatible. Doing the same here would be a much
more elegant ... but that would unfortunately not work in this case.  "--rev 7"
used to mean revision 0 to 7 - it would be an unacceptable change if it
suddenly just meant revision 7.

Instead we introduce a new configuration setting. It will only work for
Mercurial repositories so adding a new commandline option for it would not be a
nice solution.

There is no way to use the fancy deprecation markup for configuration settings
so we just remove the documentation of hg.startrev.
2013-07-20 00:43:08 +02:00
Mads Kiilerich
e49b0f2e4b convert: fix bad conversion of copies when hg.startrev is specified
The 'copynode' was looked up in self.keep as if it was a changeset node. It is
however a filelog node, and self.keep would thus fail if it actually looked at
its parameter ... which it only did if a startrev was specified.

Instead we now don't check the copy node - we don't have to. It must have been
copied from one of the parents, and we already check whether one of the parents
have the copy source.

We could perhaps use linkrev to see if the corresponding changeset was
converted ... but that would sometimes be wrong.

The existing test of this was wrong - now it is better, but it seems like it
exposes a 'log' issue.
2013-07-19 01:40:57 +02:00
Mads Kiilerich
54bd6f7939 test-convert-hg-startrev: fix test for copy removal on missing parent
The test assumed that 'b' was missing just because the changeset that
introduced 'b' wasn't converted ... but 'b' was also not removed before the
start revision, and the parent was thus not missing at all.

Instead we introduce a file 'f' in rev 0 and remove it in rev 1 so the copy
source really doesn't exist in the repo that is converted from rev 1.
2013-07-19 01:18:15 +02:00
Patrick Mezard
7e644e8129 log: fix --follow FILE ancestry calculation
Currently, --follow FILE looks for a FILE filelog, scans it and collects
linkrevs and renames, then filters them. The problem is the filelog scan does
not start at FILE filenode in parent revision but at the last filelog revision.
So:
- Files not in the parent revision can be followed, the starting node is
  unexpected
- Files in the parent revision can be followed from an incorrect starting
  node.

This patch makes log --follow FILE fail if FILE is not in parent revision, and
computes ancestors of the parent revision FILE filenode.
2012-02-24 20:57:59 +01:00
Martin Geisler
83c27fb95f tests: don't overwrite HGRCPATH
Overwriting instead of appending to the file removes the [defaults]
section put into the file by run-tests.py.

It also defeats the --inotify option to run-tests.py.

(Nothing was broken yet, but the lack of -d "0 0" cause changeset
hashes to change unexpectedly in a test case I was editing.)
2011-03-01 17:01:17 +01:00
Nicolas Dumazet
f48c256c16 revlog: fix descendants() if nullrev is in revs
We were not returning the correct result if nullrev was in revs, as we
are checking parent(currentrev) != nullrev before yielding currentrev

test-convert-hg-startrev was wrong: if we start converting from rev -1 and
onwards, all the descendants of -1 (full repo) should be converted.
2010-11-07 18:23:48 +09:00
Dan Villiom Podlaski Christiansen
f0900519c1 test-convert-hg-startrev: enable convert.hg.saverev. 2010-09-02 15:00:45 +02:00
Dan Villiom Podlaski Christiansen
6ba6fcecca tests: unify test-convert-hg-startrev. 2010-09-02 14:58:47 +02:00