File: //proc/self/root/proc/thread-self/root/usr/lib64/python2.7/site-packages/hgext/share.pyc
�
1�3\c @@ s` d Z d d l m Z d d l Z d d l m Z d d l m Z m Z m Z m
Z
m Z m Z m
Z
m Z i Z e j e � Z d Z e d d d d e d
� f d d d e d
� f d d d e d � f g e d � d e j d e �d e e e d � � Z e d g d d e j �d � � Z d � Z d � Z d � Z d � Z d � Z d � Z d S( sf share a common history between several working directories
Automatic Pooled Storage for Clones
-----------------------------------
When this extension is active, :hg:`clone` can be configured to
automatically share/pool storage across multiple clones. This
mode effectively converts :hg:`clone` to :hg:`clone` + :hg:`share`.
The benefit of using this mode is the automatic management of
store paths and intelligent pooling of related repositories.
The following ``share.`` config options influence this feature:
``share.pool``
Filesystem path where shared repository data will be stored. When
defined, :hg:`clone` will automatically use shared repository
storage instead of creating a store inside each clone.
``share.poolnaming``
How directory names in ``share.pool`` are constructed.
"identity" means the name is derived from the first changeset in the
repository. In this mode, different remotes share storage if their
root/initial changeset is identical. In this mode, the local shared
repository is an aggregate of all encountered remote repositories.
"remote" means the name is derived from the source repository's
path or URL. In this mode, storage is only shared if the path or URL
requested in the :hg:`clone` command matches exactly to a repository
that was cloned before.
The default naming mode is "identity".
i ( t absolute_importN( t _( t bookmarkst commandst errort
extensionst hgt registrart txnutilt utils ships-with-hg-coret sharet Ut noupdates! do not create a working directoryt BR s also share bookmarkst t relatives4 point to source using a relative path (EXPERIMENTAL)s [-U] [-B] SOURCE [DEST]t helpcategoryt norepoc C@ s- t j | | d | d | d | d | �d S( s� create a new shared repository
Initialize a new repository and working directory that shares its
history (and optionally bookmarks) with another repository.
.. note::
using rollback or extensions that destroy/modify history (mq,
rebase, etc.) can cause considerable confusion with shared
clones. In particular, if two shared clones are both updated to
the same changeset, and one of them destroys that changeset
with rollback, the other clone will suddenly stop working: all
operations will fail with "abort: working directory has unknown
parent". The only known workaround is to use debugsetparents on
the broken clone to reset it to a changeset that still exists.
t destt updateR R i ( R R
( t uit sourceR R R R ( ( s1 /usr/lib64/python2.7/site-packages/hgext/share.pyR
? s
t unsharec C@ s8 | j � s$ t j t d � � � n t j | | � d S( su convert a shared repository to a normal one
Copy the store data to the repo and remove the sharedpath data.
s this is not a shared repoN( t sharedR t AbortR R R ( R t repo( ( s1 /usr/lib64/python2.7/site-packages/hgext/share.pyR _ s c O@ sa | j d d � } | r* t j | � } n i | d 6| j d d � d 6| d <| | | | | � S( NR
t poolt
poolnamingt modet shareopts( t configR t
expandpath( t origR R t argst optsR ( ( s1 /usr/lib64/python2.7/site-packages/hgext/share.pyt clonel s c C@ sY t j t d t � t j t j d t � t j t j d t � t j t j d t
� d S( Nt
_getbkfilet
_recordchanget
_writerepoR# ( R t wrapfunctionR t getbkfilet bmstoret recordchanget writerepot wrapcommandR t tableR# ( R ( ( s1 /usr/lib64/python2.7/site-packages/hgext/share.pyt extsetupx s c C@ sX y | j j d � j � } Wn, t k
rJ } | j t j k rF � n t SXt j | k S( s. Returns whether this repo has shared bookmarksR ( t vfst readt
splitlinest IOErrort errnot ENOENTt FalseR t sharedbookmarks( R R t inst( ( s1 /usr/lib64/python2.7/site-packages/hgext/share.pyt _hassharedbookmarks~ s c C@ s� t | � r� t j | � } | d k r� y9 t j | j | j d � \ } } | rU | S| j � Wn+ t k
r� } | j
t
j k r� � q� n X| } q� n | | � S( NR ( R8 R t sharedreposourcet NoneR t
trypendingt rootR/ t closeR2 R3 R4 ( R R t srcrepot fpt pendingR7 ( ( s1 /usr/lib64/python2.7/site-packages/hgext/share.pyR( � s
c @ sf | � | � t � j � rb t j � j � � � d k rb d } | j | � � f d � � qb n d S( Ns share-bookmarksc @ s
� j � � S( N( R&