Commit Graph

14 Commits

Author SHA1 Message Date
Pierre-Yves David
1119f2b21b debugobsolete: display parents information from markers
Now that we have a new field, we need a way to visualize it.
2014-08-18 17:17:23 -07:00
Pierre-Yves David
a3e6a74916 debugobsolete: explicitly display date in the output
As the date is becoming a first-class citizen, we are displaying it in an
explicit field. As a bonus it is now readable by humans.
2014-08-13 23:42:36 -07:00
Pierre-Yves David
a9b7960ae6 rebase: preserve working directory parent (BC)
Prior to this changeset, rebase always left the working directory as a parent of
the last rebased changeset. The is dubious when, before the rebase, the working
directory was not a parent of the tip most rebased changeset.

With this changeset, we move the working directory back to its original parent.
If the original parent was rebased, we use it's successors.

This is a step toward solving issue3813 (rebase loses active bookmark if it's
not on a head)
2013-10-14 16:12:29 +02:00
Pierre-Yves David
681ea926e5 tests: prepare rebase test for wc parent preservation
In the way to solving issue3813 we'll preserve the working directory parent
after the rebase. Multiple rebases test expect the working directory parent to
be tip after rebase. We patches them before the actual change to prevent
confusion.
2013-10-14 16:49:54 +02:00
Augie Fackler
fe680e6bea rebase: preserve metadata from grafts of changes (issue4001) 2013-10-01 14:48:53 -04:00
Pierre-Yves David
aa5130b638 test-rebase: add another test for rebase with multiple roots
This test the case when a Merge is dropped.
2013-01-19 04:08:16 +01:00
Pierre-Yves David
b3f0e4c581 rebase: properly handle unrebased revision between rebased one
With rebase taking multiple roots it is possible to have revision in the "rebase
domain" not rebased themself. We do not want rebased revision above them to be
detached. We want such revision to be rebased on the nearest rebased ancestors.
This allows to preserve the topology of the rebase set as much a possible

To achieve this we introduce a new state `revignored` which informs
`defineparents` of the situation.

The test in `test-rebase-obsolete.t` was actually wrote and his now fixed.
2013-01-18 23:41:48 +01:00
Pierre-Yves David
b24e3849df rebase: do not invent successor to skipped changeset
When rebase results in an empty a changeset it is "skipped" and no related
changeset is created at all. When we added obsolescence support to rebase (in
cee0a253a56c) it seemed a good idea to use its parent successor as the
successors for such dropped changesets. (see old version of the altered test).
This option was chosen because it seems a good way to hint about were the
dropped changeset "intended" to be. Such hint would have been used by automatic
evolution mechanism to rebase potential unstable children.

However, field testing of this version are not conclusive. It very often leads
to the creation of (totally unfounded) evolution divergence. This changeset
changes this behavior and mark skipped changesets as pruned (obsolete without
successors). This prevents the issue and seems semantically better probably a
win for obsolescence reading tool.

See example bellow for details:

User Babar has five changesets of interest:
- O, its current base of development.
- U, the new upstream
- A and C, some development changesets
- B another development changeset independent from A

    O - A - B - C
      \
        U

Babar decides that B is more critical than the A and C and rebase it first

  $ hg rebase --rev B --dest U

B is now obsolete (in lower case bellow). Rebase result, B', is its
successors.(note, C is unstable)

    O - A - b - C
      \
        U - B'

Babar is now done with B', and want to rebase the rest of its history:

  $ hg rebase --source A --dest B'


hg rebase process A, B and C. B is skipped as all its changes are already contained
in B'.

    O - U - B' - A' - C'

Babar have the expected result graph wise, obsolescence marker are as follow:

    B -> B' (from first rebase)
    A -> A' (from second rebase)
    C -> C' (from second rebase)
    B -> ?? (from second rebase)

Before this changeset, the last marker is `B -> A'`. This cause two issues:

- This is semantically wrong. B have nothing to do with A'
- B has now two successors sets: (B',) and (A',). We detect a divergent
  rewriting. The B' and A' are reported as "divergent" to Babar, confusion
  ensues. In addition such divergent situation (divergent changeset are children
  to each other) is tricky to solve.

With this changeset the last marker is `B -> ø`:

- This is semantically better.
- B has a single successors set (B',)

This scenario is added to the tests suite.
2013-01-18 14:15:32 +01:00
Pierre-Yves David
7e632ae757 rebase: support multiple roots for rebaseset
We have all the necessary mechanism to rebase a set with multiple roots, we only
needed a proper handling of this case we preparing and concluding the rebase.
This changeset des that.

Rebase set with multiple root allows some awesome usage of rebase like:

- rebase all your draft on lastest upstream

  hg rebase --dest @ --rev 'draft()'

- exclusion of specific changeset during rebase

  hg rebase --rev '42:: - author(Babar)'

-  rebase a set of revision were multiple roots are later merged

  hg rebase --rev '(18+42)::'
2013-01-17 00:35:01 +01:00
Pierre-Yves David
4bf5a12ff2 test: fix in-test comments related to obsolescence
The `ui.prevent-unstable` option never made it into core. It always behaves
this way when obsolescence feature is enabled.

See changesets caaf2a66c719, f111507ae88a and 51dfebaadebc for details.
2013-01-16 00:46:29 +01:00
Pierre-Yves David
5fe6f9df7f rebase: allow non-head rebase-set when obsolete is enabled
Obsolescence markers can represent this situation just fine. Rebased
revisions are marked as precursors of the ones create by
rebase. Unrebased descendants becomes "unstable".

If obsolescence is not enabled we keep the current behavior of
aborting. This new behavior only applies when obsolete is
enabled and is subject to future discussion and changes.
2012-12-31 17:45:52 -06:00
Pierre-Yves David
7a06ce262e rebase: ensure rebase does not revive extinct revision
Here, we exclude hidden changesets from a rebase operation. If we
don't, a rewritten version of the hidden changesets will be created
by rebase. Those rewritten versions won't be hidden and will likely
conflict with other rewriting or revive pruned changeset. Moreover,
rewriting hidden revisions will surprise the user.

This change would not be necessary if changelog filtering were
already in core. But it's fairly cheap and helps to increase the
test-suite for such filtering.

Once changelog level filtering is added, hidden changes will be
automatically excluded or included according to the global --hidden
flags. Plain ignoring them is good enough for now.
2012-09-18 23:32:42 +02:00
Pierre-Yves David
4e2a2d8f61 rebase: properly handle --collapse when creating obsolescence marker
In collapse mode, that content of state is not suitable to compute obsolescence
markers. We explicitly pass the resulting revision instead and use it as the
successors for all elements of the rebased set.
2012-09-18 23:42:27 +02:00
Pierre-Yves David
be6378e49d rebase: allow creation obsolescence relation instead of stripping
When obsolescence feature is enabled we now create markers from the rebased
set to the resulting set instead of stripping. The "state" mapping built by
rebase holds all necessary data.

Changesets "deleted" by the rebase are marked "succeeded" by the changeset they
would be rebased one. That the best guess of "successors" we have. Getting a
successors as meaningful as possible is important for automatic resolution of
obsolescence troubles. In other word, emptied changeset will looks collapsed
with their former parents. (see "empty changeset" section of the test if you are
still confused)
2012-09-18 23:13:31 +02:00