Commit Graph

32 Commits

Author SHA1 Message Date
Yuya Nishihara
6852c0bb11 verify: do not prevent verify repository containing hidden changesets
Since afe2bc876c89, repo.cancopy() cannot be used to check if the repo is
a bundlerepository.

repo.url() should always have "scheme:", so it isn't necessary to parse
by util.url().
2014-02-19 22:19:45 +09:00
Pierre-Yves David
6265090dee clone: do not turn hidden changeset public on publishing clone (issue3935)
Before this changeset local clone of a repo with hidden changeset would include
then in the clone (why not) and turn them public (plain wrong). This happened
because the copy clone publish by dropping the phaseroot file entirely making
everything in the repo public (and therefore immune to obsolescence marker).

This changeset takes the simplest fix, we deny the copy clone in the case of hidden
changeset falling back to pull clone that will exclude them from the clone and
therefore not turning them public.

A smarter version of copy clone could be done, but I prefer to go for the
simplest solution first.
2014-01-30 11:52:38 -08:00
Brodie Rao
a446720e09 branchmap: cache open/closed branch head information
This lets us determine the open/closed state of a branch without
reading from the changelog (which can be costly over NFS and/or with
many branches).
2013-09-16 01:08:29 -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
Martin Geisler
934da465b0 phase: better error message when --force is needed
When trying to turn a draft changeset into a secret changeset, I was
told:

  % hg phase -s .
  cannot move 1 changesets to a more permissive phase, use --force
  no phases changed

That message struck me as being backwards -- the secret phase feels
less permissive to me since it restricts the changesets from being
pushed.

We don't use the word "permissive" elsewhere, 'hg help phase' talks
about "lower phases" and "higher phases". I therefore reformulated the
error message to be

  cannot move 1 changesets to a higher phase, use --force

That is not perfect either, but more in line with the help text. An
alternative could be

  cannot move phase backwards for 1 changesets, use --force

which fits better with the help text for --force.
2013-11-08 11:49:13 +01:00
Pierre-Yves David
988fc3a302 documentation: update to new filter names
Changeset 7f7f8386b285 change filter names but forgot some documentation
updates.
2013-01-21 19:40:15 +01:00
Pierre-Yves David
7bfec59c0b branchmap: update cache of 'unserved' filter on new changesets
The `commitctx` and `addchangegroup` methods of repo upgrade branchcache after
completion. This behavior aims to keep the branchcache in sync for read only
process as hgweb. See b4909adfc093 for details.

Since changelog filtering is used, those calls only update the cache for unfiltered repo.
One of no interest for typical read only process like hgweb.

Note: By chance in basic case, `repo.unfiltered() == repo.filtered('unserved')`

This changesets have the "unserved" cache updated instead. I think this is the
only cache that matter for hgweb.

We could imagine updating all possible branchcaches instead but:
- I'm not sure it would have any benefit impact. It may even increase the odd of
  all cache being invalidated.
- This is more complicated change.

So I'm going for updating a single cache only which is already better that
updating a cache nobody cares about.

This changeset have a few expected impact on the testsuite are different cache
are updated.
2013-01-16 00:08:08 +01:00
Kevin Bullock
93f9cb7f25 filtering: rename filters to their antonyms
Now that changelog filtering is in place, it's become evident that
naming the filters according to the set of revs _not_ included in the
filtered changelog is confusing. This is especially evident in the
collaborative branch cache scheme.

This changes the names of the filters to reflect the revs that _are_
included:

  hidden -> visible
  unserved -> served
  mutable -> immutable
  impactable -> base

repoview.filteredrevs is renamed to filterrevs, so that callers read a
bit more sensibly, e.g.:

  filterrevs('visible') # filter revs according to what's visible
2013-01-13 01:39:16 -06:00
Pierre-Yves David
8d44b2181d clfilter: introduces a hidden filter
This filter exclude all hidden revision. We plan to use this filter to hide
revision instead of manually checking contents of the hidden revisions set.
2013-01-07 19:24:06 +01:00
Pierre-Yves David
0cd9115520 branchmap: enable caching for filtered version too
The `_branchcache` attribute is turned into a dictionary. Key are filter name and
value is a `branchcache` object. Unfiltered version is cached as `None` filter.

The attribute is renamed to `_branchcaches` to avoid confusion with the previous
one. Both old and new contents are dictionary even if their contents are
different. I prefer possible extension code to crash right away instead of just
messing the wrong dictionary.

As all different caches work isolated to each other, this code keeps the
previous behavior of using the unfiltered cache  we nothing is filtered.  This
is a cheap way to have cache collaborate and nullify potential impact in the
default case.
2012-12-24 03:21:15 +01:00
Matt Mackall
d0aed02210 tests: fix broken fix of test-phases output 2012-11-28 17:53:52 -06:00
André Sintzoff
94ef5e50d6 phases: fix missing "error" module import (issue3707) 2012-11-25 20:39:37 +01:00
Matt Harbison
0afe294dbc outgoing: accept revset argument for --rev
There may be a more generic way that would add revset support to more commands
by adding revset support to addbranchrevs(), but given the proximity of the next
code freeze, a minimal change seems like the better choice.
2012-07-15 12:43:10 -04:00
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +02:00
Patrick Mezard
aa6e824ce1 phase: make if abort on nullid for the good reason
The good reason being you cannot call retractboundary() on nullid, not
revset.set() cannot resolve '-1'.
2012-05-12 00:24:07 +02:00
Patrick Mezard
df9b03eafa test-phases: test changing null revision phase
The behaviour is correct but for bad reasons: the repo.set() call in
phase command fails for '-1'. It should be rejected explicitely by phase
boundary commands, sadly this is hard to do because phase changes are
not applied atomically.
2012-05-10 18:21:15 +02:00
Pierre-Yves David
c37b1089b6 branchmap: server should not advertise secret changeset in branchmap (Issue3303)
Discovery now use an overlay above branchmap to prune invisible "secret"
changeset from branchmap.

To minimise impact on the code during the code freeze, this is achieve by
recomputing non-secret heads on the fly when any secret changeset exists. This
is a computation heavy approach similar to the one used for visible heads. But
few sever should contains secret changeset anyway.  See comment in code for more
robust approach.

On local repo the wrapper is applied explicitly while the wire-protocol take
care of wrapping branchmap call in a transparent way. This could be unified by
the Peter Arrenbrecht and Sune Foldager proposal of a `peer` object.

An inappropriate `(+i heads)` may still appear when pushing new changes on a
repository with secret changeset. (see Issue3394 for details)
2012-04-24 16:32:44 +02:00
Patrick Mezard
e1749878c6 phase: when phase cannot be reduced, hint at --force and return 1 (BC)
Before, trying to change the phase of a "public" node to "draft" would result
in:

  $ hg phase --draft .
  no phases changed
  [0]

With this patch:

  $ hg phase --draft .
  cannot move 1 changesets to a more permissive phase, use --force
  no phases changed
  [1]

On partial failures, the exit status is now 1 instead of 0 and the number of
changed nodes is displayed while it was only with --verbose. It seems useful to
tell the user that despite the apparent failure, something changed.

  $ hg phase --draft '5 or 7'
  cannot move 1 changesets to a more permissive phase, use --force
  phase changed for 1 changesets
  [1]
2012-02-08 20:00:52 +01:00
Pierre-Yves David
ad2799644a phases: allow phase name in phases.new-commit settings
Before this commit only phase index where accepted
2012-01-30 17:46:15 +01:00
Mads Kiilerich
e347788597 tests: don't use alias
alias doesn't work in Solaris sh.
2012-01-27 03:00:03 +01:00
Pierre-Yves David
1b001a85f3 changeset_printer: display changeset phase on debug level
Backward compatibility make it hard to display it on higher level
2012-01-17 20:23:23 +01:00
Pierre-Yves David
a04b3a6ec3 phases: exclude secret when doing a local clone
This is achieved by denying copy clone when any secret changeset exist.
2012-01-11 17:26:27 +01:00
Pierre-Yves David
32c99d5daa phases: make outgoing object and discovery aware of exclusion
The outgoing object gains an "excluded" members holding all changesets which
were excluded because there where secret.

The core discovery code now remove secret changeset from discovery by default.
This means that any command relying on discovery will exclude secret changeset.
Most notable one are outgoing and bundle. (But bundle with and explicit
``--base`` still allow to bundle outgoing changeset.
2012-01-11 00:27:46 +01:00
Pierre-Yves David
a2fe028df9 phases: add a phases command to display and manipulate phases 2012-01-10 19:45:35 +01:00
Pierre-Yves David
47a0f8f964 phases: `{phase}` template keyword display the phase name
``{phaseidx}`` is providing the phase index as integer. This integer
 representation is useful when people need to use the fact that phase are
 ordered.

Test keep using the number version for readability purpose.
2012-01-06 11:20:49 +01:00
Pierre-Yves David
074b67eb86 phases: fix phase synchronization on push
The bugs seemed to show up when element not in future common changeset should
hold new hold phase data.

The whole phase push machinery was rewritten in the process.
2012-01-04 01:12:31 +01:00
Pierre-Yves David
b6988087ea phases: implements simple revset symbol
This changeset adds ``public()``, ``draft()`` and ``secret`` symbol for
revset.
2012-01-06 10:04:20 +01:00
Pierre-Yves David
8abd0aa7c9 phases: do not exchange secret changesets
Any secret changesets will be excluded from pull and push. Phase data are
properly synchronized on pull and push if a changeset is seen as secret locally
but is non-secret remote side.

This patch does not handle the case of a changeset secret on remote but known
locally.
2011-12-22 00:42:25 +01:00
Pierre-Yves David
ef5fe34436 phases: test the new-commit option and proper inheritence of phase 2011-12-22 00:40:46 +01:00
Pierre-Yves David
6284fc8c91 phases: add a bit more test for local phase movement. 2011-12-18 23:15:12 +01:00
Pierre-Yves David
0f1186823a phases: set new commit in 1-phase 2011-11-11 00:15:22 +01:00
Pierre-Yves David
fbd6b51e95 phases: add a very simple test
Note that the expected output is wrong as is should be phase-1. But
the machinery to plant new root is to come in later commit.
2011-11-04 00:40:47 +01:00