-=[ Mr. Bumblebee ]=-
_Indonesia_
ó
Ì\,Tc @ s d Z d d l Z d d l m Z m Z m Z m Z m Z d d l m Z d d l
Z
d d l Z e d ƒ Z
\ Z Z Z e
d Z d d d g Z d d
„ Z d e f d „ ƒ YZ d
„ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d S( sä Mercurial phases support code
---
Copyright 2011 Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Logilab SA <contact@logilab.fr>
Augie Fackler <durin42@gmail.com>
This software may be used and distributed according to the terms
of the GNU General Public License version 2 or any later version.
---
This module implements most phase logic in mercurial.
Basic Concept
=============
A 'changeset phase' is an indicator that tells us how a changeset is
manipulated and communicated. The details of each phase is described
below, here we describe the properties they have in common.
Like bookmarks, phases are not stored in history and thus are not
permanent and leave no audit trail.
First, no changeset can be in two phases at once. Phases are ordered,
so they can be considered from lowest to highest. The default, lowest
phase is 'public' - this is the normal phase of existing changesets. A
child changeset can not be in a lower phase than its parents.
These phases share a hierarchy of traits:
immutable shared
public: X X
draft: X
secret:
Local commits are draft by default.
Phase Movement and Exchange
===========================
Phase data is exchanged by pushkey on pull and push. Some servers have
a publish option set, we call such a server a "publishing server".
Pushing a draft changeset to a publishing server changes the phase to
public.
A small list of fact/rules define the exchange of phase:
* old client never changes server states
* pull never changes server states
* publish and old server changesets are seen as public by client
* any secret changeset seen in another repository is lowered to at
least draft
Here is the final table summing up the 49 possible use cases of phase
exchange:
server
old publish non-publish
N X N D P N D P
old client
pull
N - X/X - X/D X/P - X/D X/P
X - X/X - X/D X/P - X/D X/P
push
X X/X X/X X/P X/P X/P X/D X/D X/P
new client
pull
N - P/X - P/D P/P - D/D P/P
D - P/X - P/D P/P - D/D P/P
P - P/X - P/D P/P - P/D P/P
push
D P/X P/X P/P P/P P/P D/D D/D P/P
P P/X P/X P/P P/P P/P P/P P/P P/P
Legend:
A/B = final state on client / state on server
* N = new/not present,
* P = public,
* D = draft,
* X = not tracked (i.e., the old client or server has no internal
way of recording the phase.)
passive = only pushes
A cell here can be read like this:
"When a new client pushes a draft changeset (D) to a publishing
server where it's not present (N), it's marked public on both
sides (P/P)."
Note: old client behave as a publishing server with draft only content
- other people see it as public
- content is pushed as draft
iÿÿÿÿN( t nullidt nullrevt bint hext short( t _i i t publict draftt secretc
C sú | j ƒ } t } g t D] } t ƒ ^ q } ye | j d ƒ } zD x= | D]5 } | j ƒ \ } } | t | ƒ j t | ƒ ƒ qJ WWd | j ƒ XWnZ t
k
rï } | j t j k r½ ‚ n | ræ x | D] } | | | ƒ } qÊ Wn t
} n X| | f S( sŽ Read phase roots from disk
phasedefaults is a list of fn(repo, roots) callable, which are
executed if the phase roots file does not exist. When phases are
being initialized on an existing repository, this could be used to
set selected changesets phase to something else than public.
Return (roots, dirty) where dirty is true if roots differ from
what is being stored.
t
phaserootsN( t
unfilteredt Falset allphasest sett sopenert splitt intt addR t closet IOErrort errnot ENOENTt True(
t repot
phasedefaultst dirtyt it rootst ft linet phaset nht inst( ( s4 /usr/lib/python2.7/dist-packages/mercurial/phases.pyt
_readrootsp s$
%
t
phasecachec B sh e Z e d „ Z d „ Z d „ Z e d „ Z d „ Z d „ Z d „ Z
d „ Z d „ Z d „ Z
RS(
c C sJ | rF t | | ƒ \ | _ | _ d | _ | j | ƒ | j | _ n d S( N( R! R R t Nonet
_phaserevst
filterunknownR t opener( t selfR R t _load( ( s4 /usr/lib/python2.7/dist-packages/mercurial/phases.pyt __init__ s
c C sJ t d d d t ƒ} | j | _ | j | _ | j | _ | j | _ | S( NR( ( R"