Commit Graph

31 Commits

Author SHA1 Message Date
Pierre-Yves David
4a16e8a21b phase: properly compute ancestors of --rev on push (issue3786)
Now that discovery is working on unfiltered changeset, I had a good occasion to
look at that bug again. This let me realise that a trivial node vs rev
comparision was the cause of this two years old bugs…

Happy second birthday phases!
2013-01-28 15:16:49 +01: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
Matt Mackall
280eec0087 tests: skip tests that require not having root (issue4089)
This adds a new root hghave to test against. Almost all of these are a
subset of unix-permissions, but that is also used for checking exec
bit handling.
2013-11-14 18:07:43 -06:00
FUJIWARA Katsunori
3198fa3830 push: hide description about "-f" in the hint to prevent from using it easily
"use push -f to force" in the hint at abortion of "hg push" may cause
novice users to execute "push -f" easily without understanding about
problems of multiple branch heads in the repository.

This patch hides description about "-f" in the hint, and leads into
seeing "hg help push" for details about pushing new heads.
2013-10-03 23:16:06 +09:00
Brendan Cully
09d28ec44c tests: skip permissions tests in test-phases-exchange when fs lacks permissions 2013-05-02 11:17:18 -07:00
Pierre-Yves David
9be8b6a846 push: make locking of source optional (issue3684)
Having the permission to lock the source repo on push is now optional. When the
repo cannot be locked, phase are not changed locally. A status message is issue
when some actual phase movement are skipped:

    cannot lock source repo, skipping local public phase update

A debug message with the exact reason of the locking failure is issued in all
case.
2013-04-30 21:19:56 +02:00
Patrick Mezard
a4c03168e1 tests: enable even more Windows server tests 2012-09-14 21:05:24 +02:00
Mads Kiilerich
2f4504e446 fix trivial spelling errors 2012-08-15 22:38:42 +02:00
Mads Kiilerich
8639b8b9e3 tests: skip new tests with requirements not available on windows 2012-04-28 01:22:56 +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
Pierre-Yves David
27796a9924 bundlerepo: bundle repos should be non-publishing (issue3266)
Bundle repo contains both the bundle content and the content of the repository
used as a base. This create bugs with phases exchange because the "remote"
repository claim to contains changeset it does not. The easiest way to fix this
bug is to ensure a bundle repo as non publishing. This way changeset will be
seen in the same phase than locally.

This patch does not alter in which phase bundle revision are seen. For now they
are seen as if an old client had add them on the remote: They inherit their
phase from parent whatever the parent is. This is to be fixed in a later patch
2012-02-29 14:41:11 +01:00
Matt Mackall
31ad230c52 pull: backout change to return code
This bit a number of people.
2012-02-10 16:09:30 -06:00
Matt Mackall
902bee47a8 pull: return 1 when no changes found (BC)
Currently we have the following return codes if nothing is found:

                commit   incoming    outgoing      pull     push
intended           1        1           1            1       1
documented         1        1           1            0       1
actual             1        1           1            0       1

This makes pull agree with the rest of the table and makes it easy to
detect "nothing was pulled" in scripts.
2012-01-30 16:01:54 -06:00
Matt Mackall
2157179ce3 push: return 1 if no changes found (issue3228)
Currently we have the following return codes if nothing is found:

                commit   incoming    outgoing      pull     push
intended           1        1           1            1       1
documented         1        1           1            0       1
actual             1        1           1            0       0

This fixes the lower-right entry.
2012-01-30 11:32:09 -06: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
7b8b0389cd push: prevent moving phases outside of the pushed subset 2012-01-20 21:21:13 +01:00
Pierre-Yves David
913d4ce095 phases: move phase according what was pushed not only what was added added
This fix the lack phase movement when a locally secret changeset without added
children was pushed to the repository. In such case, this changeset would be
present in the bundle source, but not in the ``added`` variable.
2012-01-13 01:42:47 +01:00
Pierre-Yves David
2b8de7b6ac phases: make secret changeset undiscoverable in all case
This apply the redefined stronger semantic of secret.

Secret changeset can still leak in various way. Those leak will need to be fixed individualy
2012-01-12 01:25:57 +01:00
Pierre-Yves David
c4636298a6 phases: use graph and phase name in exchange test 2012-01-07 17:03:33 +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
b57da0b2af phases: on copy clone, do not copy phases data if repote is publishing 2011-12-26 13:48:31 +01:00
Pierre-Yves David
4c85722ec4 phases: copy phases data on local clone 2011-12-26 13:47:37 +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
f9b3764a1f phases: change publish behavior to only alter behavior when server.
Older publish=True was:

  1) Content of Publishing server are seen as public by client.
  2) Any changegroup *added* to a publish=True server is public.

New definition are:

  1) Content of Publishing server are seen as public by client.
  2) Any changegroup *pushed* to a publish=True server is public.

See mercurial/phase.py documentation for exact final behavior
2011-12-15 23:08:09 +01:00
Pierre-Yves David
0d9927b223 phases: exchange phase boundaries on push
For now phase sync is tried even if push fails with some know pathological
case. The exact behavior is to be discussed and implemented later.
2011-12-15 11:45:01 +01:00
Pierre-Yves David
c8f1983f55 phases: exchange phase boundaries on pull
Add an extra argument to addchangegroup to all phase code to execute before the
lock is released.
2011-12-15 11:28:42 +01:00
Pierre-Yves David
01ab70718a phases: update exchange test to include node hash.
This will be easier for exchange test.
2011-10-26 14:30:43 +02:00
Pierre-Yves David
ca1e55e405 phases: add a phases.publish option
What is a "publishing repository"?
==================================

Setting a repository as "publishing" alter its behavior **when used as a
server**: all changesets are **seen** as public changesets by clients.

So, pushing to a "publishing" repository is the most common way to make
changesets public: pushed changesets are seen as public on the remote side and
marked as such on local side.

Note: the "publishing" property have no effects for local operations.

Old repository are publishing
=============================

Phase is the first step of a series of features aiming at handling mutable
history within mercurial. Old client do not support such feature and are unable
to hold phase data. The safest solution is to consider as public any changeset
going through an old client.

Moreover, most hosting solution will not support phase from the beginning.
Having old clients seen as public repositories will not change their usage:
public repositories where you push *immutable* public changesets *shared* with
others.

Why is "publishing" the default?
================================

We discussed above that any changeset from a non-phase aware repository should
be seen as public.  This means that in the following scenario, X is pulled as
public::

  ~/A$ old-hg init
  ~/A$ echo 'babar' > jungle
  ~/A$ old-hg commit -mA 'X'
  ~/A$ cd ../B
  ~/B$ new-hg pull ../A # let's pretend A is served by old-hg
  ~/B$ new-hg log -r tip
     summary:     X
     phase:       public

We want to keep this behavior while creating/serving the A repository with
``new-hg``. Although committing with any ``new-hg`` creates a draft changeset.
To stay backward compatible, the pull must see the new commit as public.
Non-publishing server will advertise them as draft. Having publishing repository
the default is thus necessary to ensure this backward compatibility.

This default value can also be expressed with the following sentence: "By
default, without any configuration, everything you exchange with the outside is
immutable.". This behaviour seems sane.

Why allow draft changeset in publishing repository
=====================================================

Note: The publish option is aimed at controlling the behavior of *server*.
Changeset in any state on a publishing server will **always*** be seen as public
by other client. "Passive" repository which are only used as server for pull and
push operation are not "affected" by this section.

As in the choice for default, the main reason to allow draft changeset in
publishing server is backward compatibility. With an old client, the following
scenario is valid::

  ~/A$ old-hg init
  ~/A$ echo 'babar' > jungle
  ~/A$ old-hg commit -mA 'X'
  ~/A$ old-hg qimport -r . # or any other mutable operation on X

If the default is publishing and new commits in such repository are "public" The
following operation will be denied as X will be an **immutable** public
changeset. However as other clients see X as public, any pull//push (or event
pull//pull) will mark X as public in repo A.

Allowing enforcement of public changeset only repository through config is
probably something to do. This could be done with another "strict" option or a
third value config for phase related option (mode=public, publishing(default),
mutable)
2011-12-15 11:57:33 +01:00
Pierre-Yves David
e719727169 phases: set common changeset to public on pull 2011-11-11 00:22:02 +01:00
Pierre-Yves David
bf6f3ef1a7 phases: mark content pushed as public in local repo on push 2011-11-11 00:21:17 +01:00
Pierre-Yves David
493771f789 phases: marked content of a changegroup as published 2011-11-11 00:19:00 +01:00