Commit Graph

164 Commits

Author SHA1 Message Date
Durham Goode
2cf7601f2f obsstore: fix defaultformat option passing
The obsstore format passing was not actually being passed to the obsstore. This
fixes it.
2014-10-15 12:52:10 -07:00
Pierre-Yves David
8b312ba9ed test-obsolete: remove subminute timezone in test
Obsmarker format "1" does not supports sub minute timezone. So we change the
test to something slightly more sensible.
2014-09-16 19:13:08 -07:00
Pierre-Yves David
78eab12f44 test-obsolete: sort the output of debugobsolete
The set of relevant markers is currently unordered. Therefore the
markers will be added in arbitrary order. We sort the list of markers
beforehand to ensure stable output for testing.
2014-08-20 19:47:35 -07:00
Pierre-Yves David
56469dc57f test-obsolete: change a marker so it is relevant to the exchanged set
We are going to only exchange markers relevant to the exchanged
changesets. So we need to change this marker to use a known changeset as
a successor instead of a precursor.
2014-08-20 19:42:33 -07:00
Sune Foldager
f4c36b46b4 debugrevlog: add chainlen column to --dump output 2014-08-30 11:57:46 +02:00
Pierre-Yves David
dfccc53b1c debugobsolete: add a --rev argument
This argument can be used to list markers relevant to a set of revisions. We
add a test for this option and the relevant computation in the same move.
2014-08-19 23:22:44 -07:00
Pierre-Yves David
4a696375af debugobsolete: add a way to record parent information
We add a ``--record-parents`` flag to debugobsolete. This can be used to record
parent information in the marker when the precursors are known locally. This
will be useful to test the "relevant markers" computation.
2014-08-20 00:43:08 -07:00
Pierre-Yves David
f2ec8aebea push: move bookmark discovery with other discovery steps
The discovery of necessary bookmark updates is now done within the "discovery
phase". This opens the door to the inclusion of bookmarks in a unified bundle2
push.
2014-08-15 18:39:39 -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
Matt Mackall
92e0debc2b merge with stable 2014-08-15 11:48:05 -05:00
Pierre-Yves David
8bf8eb1b78 obsstore.create: add a simple safeguard against cyclic markers
We detect when there is a cycle in the marker itself (precursors being listed
as successors).
2014-08-14 14:59:42 -07:00
Pierre-Yves David
bee675a073 push: perform phases discovery before the push
This will allow including phase information in the same bundle2 as the
changesets.
2014-07-30 19:26:47 -07:00
Pierre-Yves David
2b5f4b1f9a test-obsolete: better logging template
Gratuitous improvement of the test readability.
2014-07-04 19:52:39 +02:00
Angel Ezquerra
870dfdf91c repoview: do not crash when localtags refers to non existing revisions
This fixes a crash that may happen when using mercurial 3.0.x.

The _gethiddenblockers function assumed that the output of tags.readlocaltags()
was a dict mapping tags to of valid nodes. However this was not necessarily the
case. When a repository had obsolete revisions and had local tag pointing to a
non existing revision was found, many mercurial commands would crash.

This revision fixes the problem by removing any tags from the output of
tags.readlocaltags() which point to invalid nodes.

We may want to add a warning when this happens (although it might be
annoying to get that warning for every command, possibly even more than once per
command).

A test for this problem has been added to test-obsolete.t. Without this fix the
test would output:

  $ hg tags
  abort: 00changelog.i@3816541e5485: no node!
  [255]

Instead of:

  $ hg tags
  tiptag                             2:3816541e5485
  tip                                2:3816541e5485
  visible                            0:193e9254ce7e
2014-06-29 13:52:35 +02:00
Matt Mackall
ca3a6376d7 debugrevlog: use unfiltered view for changelog 2014-04-14 23:27:31 -04:00
Sean Farley
9b0f10caf6 repoview: add non-global tags to candidate list for blocking hidden changesets
Previously, only bookmarks would be considered for blocking a changeset from
being hidden. Now, we also consider non-global tags. This is helpful if we have
local tags that might be hard to find once they are hidden, or tag that are
added by extensions (e.g. hggit or remotebranches).
2014-03-18 20:10:33 -05: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
Kevin Bullock
b1c294188c merge with stable 2013-02-13 15:09:43 -06:00
Simon Heimberg
f8a85d58db tests: append glob to filename output when required (windows)
This lines were introduced in 78d7dc6eea93 and made the test fail on
windows.
2013-02-13 12:35:57 +01:00
Pierre-Yves David
26c59c042c outgoing: fix possible filtering crash in outgoing (issue3814)
If there is no outgoiing changesets but we have filtered revision in outgoing.excluded
We run into a filtering related crash. The excluded revision should not be there
in the first place but discovery need cleanup in default, not stable.
2013-02-09 17:54:01 +00:00
Pierre-Yves David
79b2b905b4 incoming: fix incoming when a local head is remotely filtered (issue3805)
In its current state discovery may return (remotely) filtered elements
in "common". This has usually no impact as "missing" is kept clear of
filtered elements. However when the "remote" repo is a local repo (disk
accessible, and directly created in memory) the incoming code takes a
shortcut and directly uses the "remote" repo to generate the incoming
output. When some common elements are filtered this led to a crash. We
now ensure we use an unfiltered repository to generate the incoming
output. This does not change the behavior as missing is clear of
filtered revision.

Now that we have proper low level filtering, incoming code needs a
deeper cleanup but it is already planned.
2013-02-06 07:55:29 +00:00
Matt Mackall
e9b043669f test-obsolete: now gets 404 for hidden change 2013-02-01 15:21:47 -06:00
Pierre-Yves David
32e4185163 hgweb: add a web.view to control filtering
This options add a new `web.view` to control filter level of hgweb.

This option have two purposes:

1) Allow fall back to unfiltered version in case a yet undetected by critical
   bug is found in filtering after 2.5 release

2) People use hgweb as a local repoviewer. When they have secret changesets,
   they wants to use "visible" filter not "served"

(modified by mpm, documentation deferred)
2013-01-31 19:56:55 +01:00
Mads Kiilerich
4f2a779466 tests: fix for windows - slashes and no serve 2013-01-30 19:40:07 +01:00
Pierre-Yves David
d33c391bb4 discovery: outgoing pass unfiltered repo to findcommonincoming (issue3776)
We noa pass an unfiltered repo in the same way `localrepo.push` does. This does
not alter outgoing behavior and prevents possible crash with computing
common/missing.

The `findcommonincoming` code could be simplified to make this unnecessary, but
this is too much change for the freeze.
2013-01-28 13:56:11 +01:00
Pierre-Yves David
06a33960f7 test: minor documentation fix
The related test check push, not pull.
2013-01-28 13:44:44 +01:00
Pierre-Yves David
093fc83eab changectx: fix the handling of tip
We can not use `len(repo,changelog)`, it may be a filtered revision. We now use
`repo,changelog.tip()` to fetch this information.

The `tip` command is also fixed and tested

Thanks goes to Idan Kamara for the initial report.
2013-01-22 11:39:14 +01:00
Pierre-Yves David
306badf4c6 outgoing: fix possible filtering crash in outgoing (issue3814)
If there is no outgoiing changesets but we have filtered revision in outgoing.excluded
We run into a filtering related crash. The excluded revision should not be there
in the first place but discovery need cleanup in default, not stable.
2013-02-09 17:54:01 +00:00
Augie Fackler
b2f57ecfe9 test-obsolete.t: migrate to killdaemons from kill cat pidfile 2013-02-09 05:37:36 -06:00
Pierre-Yves David
afe0e7e52e hgweb: walk the graph through the changelog
This is necessary to enforce filtering. The result is a bit buggy (may provide
less changeset than expected, but it will stop crashing on filtered revision
access.

Note that changelog.revs can not represents empty iteration like xrange did. So
we have to explicitly prevent call when there is nothing to do.
2013-01-16 14:22:43 +01:00
Pierre-Yves David
33157b2eac hgweb: ignore filtered revision in revnav
This changeset checks that a revision is known before adding it to the
navigation.

This will prevent traceback on filtered repository. This changeset result in an
incorrect behaviors, Navigation link may be dropped without any replacement.
However this bad navigation generation is much better than a crash
2013-01-16 14:19:28 +01:00
Pierre-Yves David
6c68029a60 clfilter: stronger detection of filtered changeset in changectx.__init__
We previously let some IndexError spill out of this function.

A new tests is added to check the command that spotted the error.
2013-01-16 05:21:11 +01:00
Pierre-Yves David
fd3ff2a113 hgweb: add test regarding filtering and hgweb
Since 3230dd238cf7 hgweb is broken with filtering. This changeset add test that
should pass once it is fixed. Test currently broken are commented and will be
uncommented by changeset that fix them.

The filelog test is currently passing because we already have some hack in core
regarding filelog (see 83a1b777fc02).
2013-01-16 11:39:22 -06:00
Pierre-Yves David
accb927620 clfilter: ensure that hidden filtering is working on all commands
Now that hidden changeset are filtered for all commands, we test
the behavior of `heads` and `summary` regarding hidden changeset.
2013-01-08 20:02:53 +01:00
Pierre-Yves David
a1985448ad clfilter: enforce hidden changeset globally
The dispatch code now enables filtering of "hidden" changesets globally. The
filter is installed before command and extension invocation. The `--hidden`
switch is now global and disables this filtering for any command.

Code in log dedicated to changeset exclusion is removed as this global filtering
has the same effect.
2013-01-08 20:37:37 +01:00
Pierre-Yves David
ad4e0f7344 clfilter: use filtering in visibleheads
This is the second real use of changelog filtering. The change is very small to
allow testing the new filter with a setup close to the original one.

We replace custom post processing on `heads`function by call to the standard
code pass on a filtering repo.

In later coming will have wider usage of filtering that will make the dedicated
function useless.
2012-12-17 17:27:12 +01:00
Pierre-Yves David
3c1bf60d66 test: fix truncated comment in test
The push is made to ensure repository are related. The comment in the initial
changeset got truncated somehow.
2012-12-17 17:00:24 +01:00
Pierre-Yves David
9e65b9797a clfilter: fix a false positive in the test-obsolete.t
We push between two repo which once filtered looks unrelated. Weakness in the
current implementation allows this push to be done without -f. But later
improvement with filtering will make this push fails for unrelatedness. However
we want this push to fail for including bumped changeset. So we had a smaller
push --force to make them related.
2012-11-30 21:47:04 +01:00
Pierre-Yves David
b3155544bd push: refuse to push bumped changeset
This applies the same logic as used for `obsolete` and `unstable` changesets.
Refuse to push them without force.

We'll probably want to factor this logic with two new functions
`pctx.troubled()` and `ctx.troubles()`. But I'm waiting for the third
"trouble" to make it into core.
2012-10-19 00:50:12 +02:00
push includes an xxx changeset: yyyyyyyyyy
8af08441ab obsolete: simplify push abort message
to:   push includes xxx changeset: yyyyyyyyyy
2012-10-19 00:46:39 +02:00
Pierre-Yves David
14f39efa9f obsolete: add a flag that allows fixing "bumped" changeset
The first obsolescence flag is introduced to allows for fixing the "bumped"
changeset situation.

    bumpedfix == 1.

Creator of new changesets intended to fix "bumped" situation should not forget
to add this flag to the marker. Otherwise the newly created changeset will be
bumped too. See inlined documentation for details.
2012-10-19 00:41:53 +02:00
Pierre-Yves David
d1da4847fe debugobsolete: add --flags option
This options allows to specify the `flag` part of obsolete markers. For details
about marker flags, check the `mercurial/obsolete.py` documentation. Some random
flag are added to a marker to test this feature.
2012-10-15 14:45:27 +02:00
Pierre-Yves David
6f4d6c0cd4 revset: add a bumped revset
Select bumped changesets.
2012-10-19 00:39:06 +02:00
Pierre-Yves David
57d4155cf7 obsolete: cheap detection of nullid as successors
Nullid as successors create multiple issues:

- Nullid revnum is -1, confusing algorithm that use revnum unless you add
  special handling in all of them.
- Nullid confuses "divergent" changeset detection and resolution. As you can't
  add any successors to Nullid without being in even more troubles

Fortunately, there is no good reason to use nullid as a successor. The only
sensible meaning of "succeed by nullid" is "dropped" and this meaning is already
covered by obsolescence marker with empty successors set.

However, letting some nullid successors to slip in may cause terrible damage in
such algorithm difficult to debug. So I prefer to perform and clear detection of
of such pathological changeset. We could be much smarter by cleaning up nullid
successors on the fly but it would be much for expensive. As core Mercurial does
not create any such changeset, I think it is fine to just abort when suspicious
situation is detected.

Earlier experimental version created such changesets, so there are some out
there.  The evolve extension added the necessary logic to clean up its mess.
2012-10-15 00:12:06 +02:00
Patrick Mezard
7acf48f9a1 revset: add hidden() revset 2012-08-04 20:20:48 +02:00
Thomas Arendsen Hein
5fae640775 obsolete: fix typos in comments introduced by 2a0d51a9982b 2012-07-31 15:57:50 +02:00
Pierre-Yves David
2b1b13bd1d obsolete: warns if markers exist in a repo where the feature is not enabled
We don't simply abort to allow the user to run other diagnostic commands.
2012-07-28 13:05:25 +02:00
Pierre-Yves David
6e161cf9e7 obsolete: introduce an _enabled switch to disable the feature by default
Obsolete markers wide-usage and propagation should be avoided by default until
the obsolete feature is more mature.

This changeset introduce the `_enable` variable and prevent the creation of
obsolete marker if the feature is set to `False` (the default).

More limitation comes in followup changesets.
2012-07-28 13:19:06 +02:00
Patrick Mezard
1701c358d5 debugobsolete: do not traceback on invalid node identifiers 2012-07-30 19:26:05 +02:00
Patrick Mezard
f40d444448 push: do not try to push remote obsolete if local has none 2012-07-24 21:20:56 +02:00
Pierre-Yves.David@ens-lyon.org
08abbc7fb2 clone: copy obsolete markers during local clone
This change adds `obsstore` to the list of files copied by local clone,
until now changesets were copied without their obsolete markers.

Note: extinct changesets were and are still included by such clones to
enable hardlinking. There is no obvious reason to prevent their exchange
here.

Rebased by Patrick Mezard <patrick@mezard.eu>
2012-07-25 19:02:35 +02:00
Pierre-Yves David
5e5a2af20c checkheads: take future obsoleted heads into account
If we push some successors they will likely create a new head on
remote. However as the obsoleted head will disappear after the push we
are not really increasing the number of heads.

There is several case which will lead to extra being actually pushed. But this
first changeset aims to be simple. See the inline comment for details.

Without this change, you need to push --force every time you want to
push a newer version which is very error prone.

The remote side still display +n heads on unbundle because it does not have the
obsolete marker at unbundle time.
2012-07-17 17:59:29 +02:00
Pierre-Yves.David@ens-lyon.org
a82f344ba4 obsolete: mark unreachable extinct changesets as hidden
The repo.hiddenrevs set is updated with all extinct() changesets which aren't
descendants of either:

- the current working copy,
- a bookmark,
- a tag.
2012-07-16 17:56:50 +02:00
Pierre-Yves David
648d2fdbd8 obsolete: do not exchange extinct changesets
Extinct changesets are excluded from all exchange operations. This is a silent
exclusion because the user should not need to be aware of them.

There is no reason to strongly enforce this exclusion except implementation
simplicity. User should be able to explicitly request an extinct changeset in
the future.
2012-07-13 14:38:49 +02:00
Pierre-Yves David
9e13d2931c obsolete: compute extinct changesets
`extinct` changesets are obsolete changesets with obsolete descendants only. They
are of no interest anymore and can be:

- exclude from exchange
- hidden to the user in most situation
- safely garbage collected

This changeset just allows mercurial to detect them.

The implementation is a bit naive, as for unstable changesets. We better use a
simple revset query and a cache, but simple version comes first.
2012-07-06 19:34:09 +02:00
Pierre-Yves David
3f157ec6fb push: refuse to push unstable changesets without force
User should resolve unstability locally before pushing the same way we encourage
user to merge locally instead of pushing a new remote head.

If we are to push obsolete changeset, at least one set of the pushed set will be
either obsolete or unstable. The check is narrowed to only heads.
2012-07-10 01:39:03 +02:00
Pierre-Yves David
2444c95546 obsolete: compute unstable changeset
An unstable changeset is a changeset *not* obsolete but with some obsolete
ancestors.

The current logic to decide if a changeset is unstable is naive and very
inefficient. A better solution is to compute the set of unstable changeset with
a simple revset and to cache the result. But this require cache invalidation
logic. Simpler version goes first.
2012-07-06 00:18:09 +02:00
Pierre-Yves David
940b30d287 revset: add an obsolete symbol
This predicate matches obsolete changesets.

This is a naive implementation to be improved later.
2012-07-06 19:29:10 +02:00
Pierre-Yves David
34e21f9d79 push: refuse to push obsolete changesets
This is a first version. Simple but not very efficient.

Note that this changeset introduce the "obsolete" word in the UI.
2012-07-10 01:32:18 +02:00
Pierre-Yves David
100b68ca2e obsolete: write obsolete marker inside a transaction
Marker are now written as soon as possible but within a transaction. Using a
transaction ensure a proper behavior on error and rollback compatibility.

Flush logic are not necessary anymore and are dropped from lock release.

With this changeset, the obsstore is open, written and closed for every single
added marker. This is expected to be highly inefficient and batched write should
be implemented "quickly".

Another issue is that every flush of the file will invalidate the obsstore
filecache and trigger a full re instantiation of the repo.obsstore attribute
(including, reading and parsing entry). This is also expected to be highly
inefficient and proper filecache operation should be implemented "quickly" too.

A side benefit of the filecache issue is that repo.obsstore  object is properly
invalidated on transaction abortion.
2012-07-04 02:21:04 +02:00
Pierre-Yves David
2fc08a6030 graphlog: display obsolete changeset as "x"
Changeset detected as obsolete will be displayed as "x" instead of 'o':

    o new rewritten changeset
    |
    | x old obsolete changeset
    |/
    |
    o base

This will be useful even when some obsolete changeset will be "hidden" because
not all obsolete changeset can be hidden. If an obsolete changeset have
non-obsolete descendant we can't simply hide it. And having a clear visual hint
that the changeset is obsolete is useful.

The main reason to make this minor change right now is to:

1) introduce an officiel user of the `ctx.obsolete()` method that will detect
   breakage earlier than third party code (mutable, hgview)

2) Do not display any vocabulary related to obsolete. Such vocabulary will
   require discussion.
2012-07-04 17:29:49 +02:00
Pierre-Yves.David@ens-lyon.org
d60eedc2d6 obsolete: exchange obsolete marker over pushkey
For a version of the exchange, all markers are exchange. This won't
scale and we will need a better protocol later.
2012-06-07 19:21:59 +02:00
Pierre-Yves.David@ens-lyon.org
715c9d5f3e debugobsolete: list all obsolete marker if no argument are specified 2012-06-07 19:20:44 +02:00
Pierre-Yves.David@ens-lyon.org
0d5addf62d command: creation of obsolete marker
* add metadata encoding/decoding ability

* add a method to obsstore to help creating marker

* add a debug command to create marker
2012-06-07 19:15:23 +02:00