Commit Graph

31 Commits

Author SHA1 Message Date
Mark Thomas
9a19e06fee strip: move extension to core and rename to debugstrip
Summary:
Move the strip extension to core.  Rename the command to `hg debugstrip` as it
is not intended for use by users.  Users should use `hg hide` instead.

Reviewed By: quark-zju

Differential Revision: D14185822

fbshipit-source-id: ef096488cb94b72a7bb79f5bf153c064e0555b34
2019-02-25 03:55:08 -08:00
Jun Wu
4791303cd2 obsolete: move commit reviving logic to core
Summary:
Reviving commits is an essential feature. So move it to core.

Most test changes are caused by the auto-date-bump behavior, which is needed to
revive commits automatically.

Note the existing code is not fully ready for the change. For example,
`precursors.get(node)`, `successors.get(node)` do not filter out markers that
are suppressed. For example, some code paths treat node as obsoleted if
`precursors.get(node)` is non-empty. That's no longer true.  markbt's
planned visibility change might clean up this area a bit.

Regarding on tests, most changes are because of the "auto bump date" feature.
The graphlog change in `test-obsmarker-template.t` is because it creates a
cycle, which behaves differently in the new code. Half of obsmarker exchange
tests break. Given the fact that we do not use and will probably rewrite the
exchange algorithm, related tests are deleted, including
`test-obsolete-distributed.t`.

Reviewed By: DurhamG

Differential Revision: D9236661

fbshipit-source-id: 85b983f8bd46dece908c05f56bea2abbc8ffbaf6
2018-08-18 10:51:56 -07:00
Jun Wu
7fa918cefd perftweaks: move commit head detection removal logic to core
Summary: Also change the internal API so it no longer accepts the "heads" argument.

Reviewed By: ryanmce

Differential Revision: D6745865

fbshipit-source-id: 368742be49b192f7630421003552d0a10eb0b76d
2018-04-13 21:50:52 -07:00
Matt Harbison
7d8bebd9c1 tests: remove (glob) annotations that were only for '\' matches
# skip-blame because this was mechanically rewritten the following script.  I
ran it on both *.t and *.py, but none of the *.py changes were proper.  All *.t
ones appear to be, and they run without addition failures on both Windows and
Linux.

  import argparse
  import os
  import re

  ap = argparse.ArgumentParser()
  ap.add_argument('path', nargs='+')
  opts = ap.parse_args()

  globre = re.compile(r'^(.*) \(glob\)(.*)$')

  for p in opts.path:
      tmp = p + '.tmp'
      with open(p, 'rb') as src, open(tmp, 'wb') as dst:
          for line in src:
              m = globre.match(line)
              if not m or '$LOCALIP' in line or '*' in line:
                  dst.write(line)
                  continue
              if '?' in line[:-3] or ('?' in line[:-3] and line[-3:] != '(?)'):
                  dst.write(line)
                  continue
              dst.write(m.group(1) + m.group(2) + '\n')
      os.unlink(p)
      os.rename(tmp, p)
2017-12-10 22:50:57 -05:00
Boris Feld
7aaf02f1ae config: rename stabilization.bundle-obsmarker
We want to get rid of stabilization.* configuration, back out to the old
configuration 'evolution.bundle-obsmarker'.

Differential Revision: https://phab.mercurial-scm.org/D1152
2017-10-17 15:54:05 +02:00
Boris Feld
3276655886 config: replace experimental.stabilization by experimental.evolution
We replace 'experimental.stabilization=all' by 'experimental.evolution=true'
as we will extract individual config in their own config in later patches.

Differential Revision: https://phab.mercurial-scm.org/D1148
2017-10-17 11:29:26 +02:00
Denis Laxalde
9efc7f05e3 transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Upon pull or unbundle, we display a message with the range of new revisions
fetched. This revision range could readily be used after a pull to look out
what's new with 'hg log'. The algorithm takes care of filtering "obsolete"
revisions that might be present in transaction's "changes" but should not be
displayed to the end user.
2017-10-12 09:39:50 +02:00
Boris Feld
c886c86073 test: update evolution config
evolution* config has been rewritten in stabilization* in the previous patch,
update tests file to use the new names.

Differential Revision: https://phab.mercurial-scm.org/D249
2017-08-04 18:41:16 +02:00
Boris Feld
b989852f8f debugobsolete: also report the number of obsoleted changesets
This seems useful to have the number of obsoleted changesets when calling
debugobsolete.
2017-07-16 02:33:14 +02:00
Pierre-Yves David
5e97e55c0f obsolete: reports the number of local changeset obsoleted when unbundling
This is a first basic visible usage of the changes tracking in the transaction.
We adds a new function computing the pre-existing changesets obsoleted by a
transaction and a transaction call back displaying this information.

Example output:

  added 1 changesets with 1 changes to 1 files (+1 heads)
  3 new obsolescence markers
  obsoleted 1 changesets

The goal is to evolve the transaction summary into something bigger, gathering
existing output there and adding new useful one. This patch is a good first step
on this road. The new output is basic but give a user to the content of
tr.changes['obsmarkers'] and give an idea of the new options we haves. I expect
to revisit the message soon.

The caller recording the transaction summary should also be moved into a more
generic location but further refactoring is needed before it can happen.
2017-06-28 03:54:19 +02:00
Danek Duvall
9231e311ce debugbundle: add --part-type flag to emit only named part types
This removes the need in the tests for grep -A, which is not supported on
Solaris.
2017-06-05 16:19:41 -07:00
Matt Harbison
c1192b9b13 test-obsolete-bundle-strip: add globs for Windows 2017-06-05 20:37:45 -04:00
Yuya Nishihara
2a6bbffb41 test-obsolete-bundle-strip: do not include \n in filename (issue5586) 2017-06-05 23:23:03 +09:00
Martin von Zweigbergk
8a01c6200d tests: simplify and clarify test-obsolete-bundle-strip.t a little 2017-06-02 23:05:03 -07:00
Martin von Zweigbergk
14d7cb9694 tests: add missing parens in test-obsolete-bundle-strip.t
The "(not ${revs})" was missing parens around ${revs}, so when revs
was "A + B", it became "(not A + B)" when actually "(not (A + B))" was
intended. Fixing that leads to some more testing of strip.

Similarly, the parens were missing in "${revs}::", making it "A + B::"
instead of "(A + B)::". Thanks to Yuya for noticing this part. This
did not affect any existing tests.
2017-06-02 23:29:20 -07:00
Pierre-Yves David
8d733e89bc strip: strip obsmarkers exclusive to the stripped changeset
This is it, `hg strip --rev X` will now also remove obsolescence markers
exclusive to X. Since a previous changeset, the obsmarkers has been backed up
in the strip backup bundle, so it is possible to restore them.

Note: stripping obsmarkers means the precursors of the stripped changeset might no
longer be obsolete after the strip.

Stripping changeset without obsmarkers can be useful when building test case. So
It is possible to disable the stripping of obsmarkers using the
'devel.strip-obsmarkers' config option.

Test change have been carefully validated.
2017-05-20 16:19:59 +02:00
Pierre-Yves David
e928751835 exclusive-markers: update the dedicated test with list of exclusive markers
We now display data about the "exclusive markers" in the test dedicated to
relevant and exclusive markers computation and usage. Each output have been
carefully validated
2017-06-01 08:44:01 +02:00
Pierre-Yves David
c585fcb0e0 test-obsolete-bundle-strip: check all changesets in the isolated prune case
We also want to check the result of the various computations when both
changesets are selected (the pruned changesets and its parents).
2017-06-01 08:32:24 +02:00
Pierre-Yves David
c7c38a40ed test-obsolete-bundle-strip: add testing of markers backup during strip
When applicable, we strip the revision tested in the test and we check that the
backup bundle contains the appropriate markers.
2017-05-26 03:52:11 +02:00
Pierre-Yves David
d6b54fa85e test-obsolete-bundle-strip: test bundling in the seventh case
Updating all cases in the file at the same time is a bit overwhelming and harder
to double check. So each case come in its own patch.
2017-05-26 03:41:10 +02:00
Pierre-Yves David
d7f31c6f69 test-obsolete-bundle-strip: test bundling in the sixth case
Updating all cases in the file at the same time is a bit overwhelming and harder
to double check. So each case come in its own patch.
2017-05-26 03:23:56 +02:00
Pierre-Yves David
ea6290d3cb test-obsolete-bundle-strip: test bundling in the fifth case
Updating all cases in the file at the same time is a bit overwhelming and harder
to double check. So each case come in its own patch.
2017-05-26 03:20:40 +02:00
Pierre-Yves David
e3cec1209c test-obsolete-bundle-strip: test bundling in the fourth case
Updating all cases in the file at the same time is a bit
overwhelming and harder to double check. So each case come in its own patch.
2017-05-26 03:20:25 +02:00
Pierre-Yves David
0a1e58b32e test-obsolete-bundle-strip: test bundling in the third case
Updating all cases in the file at the same time is a bit overwhelming and harder
to double check. So each case come in its own patch.
2017-05-26 03:19:11 +02:00
Pierre-Yves David
c03c70a969 test-obsolete-bundle-strip: test bundling in the second case
Updating all cases in the file at the same time is a bit overwhelming and harder
to double check. So each case come in its own patch.
2017-05-26 03:15:53 +02:00
Pierre-Yves David
a24dcd3af0 test-obsolete-bundle-strip: test bundling in the first case
We adds a shell function checking that the relevant markers and the bundled
markers matches. Updating all cases in the file at the same time is a bit
overwhelming and harder to double checks. So each cases come in its own patch.
2017-05-26 03:11:53 +02:00
Pierre-Yves David
636283dca4 test: add isolated prune case (to test-obsolete-bundle-strip.t)
This adds a test where the prune marker is not related to any other obsmarkers.
2017-05-25 19:38:00 +02:00
Pierre-Yves David
9e015c520e test-obsolete-bundle-strip: add a complex split and fold case
This is a more complex case that checks the logic used when split and fold gets
into play.
2017-05-25 19:37:47 +02:00
Pierre-Yves David
7a14094fa3 test-obsolete-bundle-strip: add cases with prune on missing revs
Same as the previously added case, but the prune is no longer known locally.
This will mostly matter for the strip testing. Introducing the test early will
help clarify patches related to strip.
2017-05-25 19:37:29 +02:00
Pierre-Yves David
1a819b73cb obsolete: fix relevant-obsmarkers computation on pruned changeset
The markers pruning a node was not directly considered relevant for the pruned
node, only to its parents.

This went unnoticed during obsmarkers exchange because all
ancestors of the pruned node would be included in the computation.
This still affects obsmarkers exchange a bit since "inline" prune markers would
be ignored (see second test case). This went unnoticed, because in such case,
we always push another obsolescence markers for that node.

We add explicit tests covering this case.

(The set of relevant changeset is use in the obsmarkers discovery protocol used
in the evolve experimental extension, the impact will be handled on the
extension side).
2017-05-25 19:37:29 +02:00
Pierre-Yves David
477904fd0f test: add a test file for relevant obsmarkers and its usage
The logic around obsmarkers "relevant" to a set of revs have a couple of test
around in other places but no systematic testing. In addition, all the current
testing focus on the exchange case (we looks at relevant markers for
'::heads').

For bundles, we'll need something a bit different. We'll no longer have set of
revision going down to the repository roots. So we'll have to test these cases
too. In addition, stripping obsmarkers will introduce new logic around
obsmarkers that will need testing too. So a new test file make sense here.

We start with a simple tests, more advanced cases are coming in the next
changesets. The extra testing catch a minor bug (later in the series).
2017-05-25 19:37:07 +02:00