mò
Gì‰Dc           @   sC  d  Z  d k Z d k Z d k Z d k Z d k Z d k Z d k l Z l	 Z	 d k
 Z d k Z d k Z d k Td k i Z d k l Z d k Z d k l Z l Z d k Z d k l Z d k l Z l Z d k l Z d	 k l  Z  d k! Z d
 „  Z" d „  Z# d e$ f d „  ƒ  YZ% d e i& i' f d „  ƒ  YZ( d e i) i* f d „  ƒ  YZ+ d e i, i- f d „  ƒ  YZ. d e i/ i0 f d „  ƒ  YZ1 d e i2 i3 f d „  ƒ  YZ4 d e i2 i5 f d „  ƒ  YZ6 e i2 i5 i7 e6 ƒ d e i2 i8 f d „  ƒ  YZ9 d e i) i: f d „  ƒ  YZ; e i) i: i< e; ƒ d „  Z= d e f d  „  ƒ  YZ> d S(!   s‰  Hg support for bzr.

hg and bzr have different restrictions placed n revision ids. Its not possible
with the current hg model to allow bzr to write sanely to hg. However its
possibe to get bzr data out of hg.

The key translations needed are:
 * in bzr we use a revision id of "hg:" + hex(hgrevid) to ensure we can 
   always utf8 encode it.
 * we convert manifests to inventories on the fly.
N(   s   hexs   bin(   t   *(   s	   Inventory(   s   split_liness   sha_strings(   s   Revision(   s
   TestLoaders   TestCaseWithTransport(   s   LocalTransport(   s	   topo_sortc         C   s   t  |  d ƒ S(   Ni   (   t   bint   revision_id(   R   (    (    t+   /home/jelmer/.bazaar/plugins/hg/__init__.pyt   hgrevid_from_bzr7   s    c         C   s   d t  |  ƒ S(   Ns   hg:(   t   hexR   (   R   (    (    R   t   bzrrevid_from_hg;   s    t   HgLockc           B   s2   t  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s!   A lock that thunks through to Hg.c         C   s   | |  _ d  S(   N(   t   hgrepot   selft   _hgrepo(   R	   R   (    (    R   t   __init__B   s    c         C   s   |  i i ƒ  |  _ d  S(   N(   R	   R
   t   wlockt   _lock(   R	   (    (    R   t
   lock_writeE   s    c         C   s   |  i i ƒ  |  _ d  S(   N(   R	   R
   t   lockR   (   R	   (    (    R   t	   lock_readH   s    c         C   s   |  i i ƒ  d  S(   N(   R	   R   t   release(   R	   (    (    R   t   unlockK   s    (   t   __name__t
   __module__t   __doc__R   R   R   R   (    (    (    R   R   ?   s
    			t   HgLockableFilesc           B   s   t  Z d  Z d „  Z RS(   s'   Hg specific lockable files abstraction.c         C   s(   | |  _ d  |  _ d  |  _ d |  _ d  S(   Ni    (   R   R	   R   t   Nonet   _transactiont
   _lock_modet   _lock_count(   R	   R   (    (    R   R   R   s    			(   R   R   R   R   (    (    (    R   R   O   s    t   HgRepositoryc           B   s>   t  Z d  Z d „  Z d „  Z d „  Z e d „ Z d „  Z RS(   s-   An adapter to mercurial repositories for bzr.c         C   s   | |  _ | |  _ | |  _ d  S(   N(   R   R	   R
   t   hgdirt   bzrdirt	   lockfilest   control_files(   R	   R   R   R   (    (    R   R   \   s    		c   "         sï  t  | ƒ } |  i i i | ƒ } |  i i i | d ƒ } |  i i i	 | d ƒ }  |  i | ƒ ‰ h  ‰  t ƒ  ‰ h  ‰ ‡  ‡ d †  ‰ d „  ‰ ‡ d †  ‰ ‡ ‡ ‡ ‡ ‡ d †  ‰ h  } xù| i ƒ  D]ë\ }	 } |  i i |	 ƒ } | i | ƒ } | } g  } | } t |  i i i  | ƒ ƒ } | } t ƒ  } xð | oè | i$ ƒ  } | t& i' i( j o q2n | | j o6 |  i i i | ƒ d } |  i i i | ƒ | | <n | | } | i* | ƒ | i+ |	 d ƒ | j o q2n | } x; |  i i i  | ƒ D]$ }
 |
 | j o | i* |
 ƒ qõqõWq2Wt. | ƒ } ˆ |	 | ƒ ˆ i0 |	 d d ˆ |	 ƒ ƒ} | i2 | i3 | ƒ | _4 | i | ƒ } t6 | ƒ | _7 |  |	 o t8 | _9 n | | _: qÆ Wx3 ˆ i ƒ  D]% \ }! } ˆ |! ƒ } | ˆ | _: qÂWˆ S(	   sb  Synthesize a bzr inventory from an hg manifest...

        how this works:
        we grab the manifest for revision_id
        we create an Inventory
        for each file in the manifest we:
            * if the dirname of the file is not in the inventory, we add it
              recursively, with an id of the path with / replaced by :, and a 
              prefix of 'hg:'. The directory gets a last-modified value of the
              topologically oldest file.revision value under it in the 
              inventory. In the event of multiple revisions with no topological
              winner - that is where there is more than one root, alpha-sorting
              is used as a tie-break.
            * use the files revlog to get the 'linkrev' of the file which 
              takes us to the revision id that introduced that revision. That
              revision becomes the revision_id in the inventory
            * check for executable status in the manifest flags
            * add an entry for the file, of type file, executable if needed,
              and an id of 'hg:path' with / replaced by :.
        i    c            s¯   y ˆ  |  SWn t j
 o n Xt ƒ  } t |  g ƒ } xd t | ƒ d j oP | i ƒ  } | i	 | ƒ x0 ˆ | D]$ } | | j o | i	 | ƒ qt qt Wq= W| ˆ  |  <| S(   Ni    (   t   ancestry_cachet   some_revision_idt   KeyErrort   sett   ancestryt   pendingt   lent   popt   nodet   addt   all_relevant_revisionst	   parent_id(   R!   R(   R+   R$   R%   (   R    R*   (    R   t   get_ancestry„   s     	  
c         C   s   d |  i d d ƒ S(   s*   Create a synthetic file_id for an hg file.s   hg:t   /t   :N(   t   patht   replace(   R/   (    (    R   t   path_id•   s     c            sS   |  ˆ  | ƒ j o |  Sn5 | ˆ  |  ƒ j o | Sn |  | j  o |  Sn | Sd S(   sÄ   Picks the best creator revision from a and b.

            If a is an ancestor of b, a wins, and vice verca.
            If neither is an ancestor of the other, the lowest value wins.
            N(   t
   revision_aR,   t
   revision_b(   R2   R3   (   R,   (    R   t   pick_best_creator_revision˜   s     c            s¹   t  i i |  ƒ } | d j o d Sn ˆ i | ƒ oI ˆ  | } ˆ | | ƒ } | | j o ˆ | | ƒ | ˆ  | <n d Sn ˆ | | ƒ | ˆ  | <ˆ i | d d ˆ | ƒ ƒ} d S(   sŒ   ensure that file can be added by adding its parents.

            this is horribly inefficient at the moment, proof of concept.
            t    Nt	   directoryt   file_id(   t   osR/   t   dirnamet   filet   resultt   has_filenamet   directoriest   current_bestR4   t   file_revision_idt   new_bestt   add_dir_fort   add_pathR1   t   entry(   R:   R?   R>   R@   RC   R/   (   R=   RA   R1   R;   R4   (    R   RA   ¨   s     

R:   R7   N(>   R   R   t   hgidR	   R
   t	   changelogt   readt   logt   manifestt	   readflagst   manifest_flagst   get_revision_graphR*   R    t	   InventoryR;   R=   R,   R1   R4   RA   t   known_manifestst   itemsR:   t   file_revisiont   revlogt   linkrevt   changelog_indext   current_logt
   file_tailst   current_manifestR#   t   parentst
   parent_clst   good_idt   done_clsR'   t
   current_clt	   mercurialR(   t   nullidt   current_manifest_idR)   t   getR   t	   parent_clR   t   modified_revisionRB   RC   t   sizet   nodemapt	   text_sizet   textt   sha_stringst	   text_sha1t   Truet
   executablet   revisiont   dirt   dir_revision_idt   dirid("   R	   R   Rk   RP   R    RY   RA   RO   R;   R:   R_   RM   RG   Rd   RW   R4   RZ   R]   R`   R*   RS   RT   R,   R=   RU   RX   RH   R1   RR   RC   Rl   RD   RJ   Rj   (    (   R    RA   R;   R4   R*   R,   R=   R1   R   t   get_inventorya   sp     		  	 
  c         C   sÿ   t  | ƒ } |  i i i t | ƒ ƒ } |  i i i	 t | ƒ ƒ } g  | _ | d t i i j o | i i t | d ƒ ƒ n | d t i i j o | i i t | d ƒ ƒ n | d | _ d | _ | d d | _ | d d | _ | d | _ | S(   Ni    i   i   R5   i   (   t   RevisionR   R;   R	   R
   RE   RF   R   t   hgchangeRV   t	   hgparentst
   parent_idsR[   R(   R\   t   appendR   t   messaget   inventory_sha1t   timezonet	   timestampt	   committer(   R	   R   Rp   R;   Ro   (    (    R   t   get_revisionú   s    		c         C   sª   | d  j o t d ƒ ‚ nŠ h  } t | g ƒ } xm t | ƒ d j oY | i ƒ  } |  i
 | ƒ i | | <x0 | | D]$ } | | j o | i | ƒ qu qu Wq5 W| Sd  S(   Ns7   get_revision_graph with no parents not implemented yet.i    (   R   R   t   NotImplementedErrorR;   R#   R%   R&   R'   R(   R	   Rx   Rq   R)   (   R	   R   R(   R;   R%   (    (    R   RK   
  s      c         C   s   t  | ƒ |  i i i j S(   N(   R   R   R	   R
   RE   Rb   (   R	   R   (    (    R   t   has_revision  s    (	   R   R   R   R   Rm   Rx   R   RK   Rz   (    (    (    R   R   Y   s    		™	t   HgBranchc           B   sh   t  Z d  Z d „  Z d „  Z e d „  ƒ Z e d „  ƒ Z d „  Z d „  Z	 e
 d „ Z e
 d „ Z RS(	   s<   An adapter to mercurial repositories for bzr Branch objects.c         C   sC   | |  _ | |  _ | |  _ t | | | ƒ |  _ | i	 i
 |  _
 d  S(   N(   R   R	   R
   R   R   R   R   R   t
   repositoryt   root_transportt   base(   R	   R   R   R   (    (    R   R      s
    			c         C   s   |  i i ƒ  d  S(   N(   R	   R   R   (   R	   (    (    R   R   '  s    c         C   si   t  |  i ƒ  ƒ } g  } | } xD | t i i j o0 | i	 t
 | ƒ ƒ |  i i i | ƒ d } q! W| S(   Ni    (   R   R	   t   last_revisiont   tipt   revst   next_revR[   R(   R\   Rr   R   R
   RE   RV   (   R	   R‚   R€   R   (    (    R   t   revision_history*  s     c         C   s   t  |  i i i ƒ  ƒ S(   N(   R   R	   R
   RE   R€   (   R	   (    (    R   R   4  s    c         C   s   |  i i ƒ  d  S(   N(   R	   R   R   (   R	   (    (    R   R   9  s    c         C   s   |  i i ƒ  d  S(   N(   R	   R   R   (   R	   (    (    R   R   <  s    c         C   s   d  S(   N(    (   R	   t   destinationR   (    (    R   t   copy_content_into?  s    c         C   s!   t  | t ƒ p t ‚ | i ƒ  S(   N(   t
   isinstancet	   to_bzrdirt   HgDirt   AssertionErrort   open_branch(   R	   R‡   R   (    (    R   t   cloneB  s    (   R   R   R   R   R   t   needs_read_lockRƒ   R   R   R   R   R…   R‹   (    (    (    R   R{     s    		
		t   HgWorkingTreec           B   sA   t  Z d  Z d „  Z e e d „ ƒ Z e d „  ƒ Z d „  Z RS(   sA   An adapter to mercurial repositories for bzr WorkingTree obejcts.c         C   s4   | |  _ | |  _ | |  _ t | | | ƒ |  _ d  S(   N(	   R   R	   R
   R   R   R   t   _control_filesR{   t   _branch(   R	   R   R   R   (    (    R   R   L  s    			c         C   sg   t  | t ƒ o | g } n g  } | D] } | | i d ƒ q( ~ } |  i i	 | d |  i
 i ƒd  S(   Nt   utf8R   (   R†   t   filest
   basestringt   _[1]R:   t   encodet   pathsR	   R
   R)   RŽ   R   (   R	   R‘   t   idsR•   R“   R:   (    (    R   R)   R  s    *c         O   sJ   t  i i |  i ƒ \ } } } |  i i g  | d  d  | d |  i i ƒd  S(   NR   (   R[   t   commandst	   matchpatsR	   R
   R‘   t   matchfnt   anypatst   commitRs   R   RŽ   R   (   R	   Rs   t   argst   kwargsR‘   R™   Rš   (    (    R   R›   [  s    c         C   s&   z |  i i ƒ  SWd |  i i ƒ  Xd S(   s6   Overridden to avoid hashcache usage - hg manages that.N(   R	   RŽ   R   t   branch(   R	   (    (    R   R   d  s
      (	   R   R   R   R   t   needs_write_lockR   R)   R›   R   (    (    (    R   R   I  s
    			Rˆ   c           B   s¡   t  Z d  Z d „  Z d „  Z e e e d „ Z d „  Z e d „ Z	 e d „ Z
 d „  Z e Z e Z d „  Z e d	 „ Z e d
 „ Z e d „ Z e d „ Z RS(   s.   An adapter to the '.hg' dir used by mercurial.c         C   s:   | |  _ | |  _ | i d ƒ |  _ | |  _ | |  _	 d  S(   Ns   .hg(
   t   formatR	   t   _formatt	   transportR}   R‹   R   R
   R   t
   _lockfiles(   R	   R   R¢   R   R    (    (    R   R   o  s
    			c         C   s   t  |  i ƒ ‚ d S(   s   Mercurial locks never break.N(   Ry   R	   t
   break_lock(   R	   (    (    R   R¤   v  s     c         C   si   |  i | ƒ | i d ƒ o | t d ƒ } n | i d ƒ } |  i i | ƒ } | i	 i
 |  i	 ƒ | S(   s   Clone this hg dir to url.s   file://R   N(   R	   t
   _make_tailt   urlt
   startswithR&   R”   R¡   t
   initializeR;   R
   t   pull(   R	   R¦   R   t   basist   force_new_repoR;   (    (    R   R‹   z  s     c         C   s   t  |  i |  |  i ƒ S(   s   'crate' a branch for this dir.N(   R{   R	   R
   R£   (   R	   (    (    R   t   create_branch„  s     c         C   s9   | o t i |  i |  i ƒ ‚ n t |  i |  |  i ƒ S(   s#   'create' a repository for this dir.N(   t   sharedt   errorst   IncompatibleFormatR	   R¡   R   R
   R£   (   R	   R­   (    (    R   t   create_repositoryˆ  s     c         C   s   t  |  i |  |  i ƒ S(   s$   'create' a workingtree for this dir.N(   R   R	   R
   R£   (   R	   R­   (    (    R   t   create_workingtree  s     c         C   sL   | d  j o |  i Sn t | t ƒ o |  i Sn t i | |  i ƒ ‚ d  S(   N(	   t   branch_formatR   R	   R¢   R†   t   HgBzrDirFormatR®   R¯   R¡   (   R	   R²   (    (    R   t   get_branch_transport“  s
    c         C   s   t  S(   N(   Rg   (   R	   (    (    R   t   is_supported  s    c         C   s   t  S(   N(   Rg   (   R	   R    (    (    R   t   needs_format_conversion   s    c         C   s   t  |  i |  |  i ƒ S(   s   'crate' a branch for this dir.N(   R{   R	   R
   R£   (   R	   t   ignored(    (    R   RŠ   £  s     c         C   s   t  |  i |  |  i ƒ S(   s!   'open' a repository for this dir.N(   R   R	   R
   R£   (   R	   R­   (    (    R   t   open_repository§  s     c         C   s   t  |  i |  |  i ƒ S(   s"   'open' a workingtree for this dir.N(   R   R	   R
   R£   (   R	   R­   (    (    R   t   open_workingtree«  s     (   R   R   R   R   R¤   R   t   FalseR‹   R¬   R°   R±   R´   t   get_repository_transportt   get_workingtree_transportRµ   R¶   RŠ   R¸   R¹   (    (    (    R   Rˆ   l  s    		
			R³   c           B   sM   t  Z d  Z d „  Z d „  Z e d „  ƒ Z e e d „ Z	 e d „  ƒ Z
 RS(   s!   The .hg directory control format.c         C   s   t  ƒ  S(   s   We should write a converter.N(   t   HgToSomethingConverter(   R	   (    (    R   t   get_converter³  s     c         C   s   |  i | d t ƒS(   s?   Initialize a new .not dir in the base directory of a Transport.t   _createN(   R	   t   openR¢   Rg   (   R	   R¢   (    (    R   t   initialize_on_transport·  s     c         C   s   t  t ƒ  g ƒ S(   N(   R#   R³   (   R	   (    (    R   t   _known_formats»  s    c         C   s¯   | i } | i d ƒ o | t d ƒ } n | i d ƒ o | t d ƒ } n | i d ƒ } t i i ƒ  } t i i	 | | d | ƒ} t t | ƒ ƒ } t | | | |  ƒ S(   sw   Open this directory.
        
        :param _create: create the hg dir on the fly. private to HgBzrDirFormat.
        s	   readonly+s   file://R   t   createN(   R¢   R~   R¦   R§   R&   R”   R[   t   uit   hgR|   R¿   R   R   R   Rˆ   R	   (   R	   R¢   R¿   t   _foundR   R|   R¦   RÄ   (    (    R   RÀ   ¿  s     	c         C   s|   |  ƒ  } | i d ƒ o | Sn y | i | ƒ | SWn* t j
 o } t i d | i	 ƒ ‚ n Xt i d | i	 ƒ ‚ d S(   s7   Our format is present if the transport ends in '.not/'.s   .hgR/   N(
   t   klassR    R¢   t   hasRÀ   t	   Exceptiont   eR®   t   NotBranchErrorR~   (   RÇ   R¢   RÊ   R    (    (    R   t   probe_transportÐ  s     	(   R   R   R   R¾   RÁ   t   classmethodRÂ   Rº   R   RÀ   RÌ   (    (    (    R   R³   °  s    		R½   c           B   s   t  Z d  Z RS(   s/   A class to upgrade an hg dir to something else.(   R   R   R   (    (    (    R   R½   ç  s   t   InterHgRepositoryc           B   sM   t  Z d  Z e Z e e e d „ ƒ Z e e e d „ ƒ Z e d „  ƒ Z	 RS(   s   Hg to any repository actions.c         C   s?   | d j p t ‚ | d j p t ‚ |  i i |  i ƒ d S(   s“   See InterRepository.copy_content. Partial implementation of that.

        To date the revision_id and basis parameters are not supported.
        N(   R   R   R‰   Rª   R	   t   targett   fetcht   source(   R	   R   Rª   (    (    R   t   copy_contentð  s     c         C   sµ  h  }
 | d j o t d ƒ ‚ n t | g ƒ } h  } x¬ t | ƒ d j o˜ | i ƒ  } |  i i | ƒ o |  i i | ƒ i } n$ |  i i | ƒ |
 | <|
 | i } | | | <x, | D]$ } | | j o | i | ƒ qº qº Wq; W|  i } |  i i ƒ  } t | i ƒ  ƒ } g  } | D] } | |
 j o | | qq~ } t | ƒ } h  } t i i i ƒ  } z6x/t  | ƒ D]!\ } } | i" d | | ƒ |
 | } |  i i$ | ƒ } | | | <t& | ƒ } |  i i( i) i* | ƒ }	 |  i i( i, i* |	 d ƒ } xm| D]e} | t i% i. j o qn | | } | | i# | j o'| | } g  } xc | i D]X } y | i2 | | ƒ Wq[t3 j
 o. |  i i$ | ƒ | | <| i2 | | ƒ q[Xq[W| i4 | | i5 | ƒ } | i7 d j o | i8 g  | | i5 | ƒ qh| i9 | ƒ } |  i i( i; | ƒ } | | } | i* | ƒ } t? | ƒ } | i8 t? | ƒ | | i5 | ƒ qqW|  i iA | | | i ƒ |  i iB | | ƒ qwWWd | iC ƒ  X| d f S(   s2   Fetch revisions. This is a partial implementation.s+   fetching of everything not yet implemented.i    s   fetching revisionsR6   N(D   t   neededR   R   Ry   R#   R%   t   needed_graphR&   R'   R(   R	   RÏ   Rz   Rx   Rq   RÑ   R)   t   target_repot   get_transactiont   target_transactiont	   topo_sortRN   t   orderR“   t   rev_idt   totalt   inventoriest   bzrlibRÄ   t
   ui_factoryt   nested_progress_bart   pbt	   enumeratet   indext   updateRi   Rm   t	   inventoryR   t   hgrevidR
   RE   RF   RG   RH   t   fileidt   ROOT_IDRC   t   previous_inventoriest   parentRr   R"   t   find_previous_headst   weave_storet
   file_headst   kindt   _add_text_to_weavet   id2pathR/   R:   RP   t   filerevRd   t   split_linest   linest   add_inventoryt   add_revisiont   finished(   R	   R   Rà   RP   Rì   RÕ   RÜ   Râ   RÛ   RG   RÓ   Rä   Rd   Rè   RH   R%   RÚ   R(   Ræ   Ré   Rð   Rq   R×   R/   RÔ   Rå   Rò   R“   RC   Ri   RÙ   (    (    R   RÐ   ú  s     	 
 	2 

 


 			
 c         C   s   t  |  t ƒ S(   s"   Be compatible with HgRepositories.N(   R†   RÑ   R   (   RÑ   RÏ   (    (    R   t   is_compatiblea  s     (
   R   R   R   R   t   _matching_repo_formatRŸ   RÒ   RÐ   t   staticmethodRö   (    (    (    R   RÎ   ê  s     
gc           C   s   t  ƒ  i t ƒ S(   N(   t
   TestLoadert   loadTestsFromNameR   (    (    (    R   t
   test_suiteh  s    t   TestPullingc           B   sD   t  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s!   Tests for pulling from hg to bzr.c         C   s¹  t  t |  ƒ i ƒ  |  i d d d d d g ƒ t ƒ  i d ƒ } | i ƒ  |  _	 t
 i d ƒ i } t
 i d | t i Bƒ |  i	 i d d d	 g ƒ |  i	 i d
 ƒ t ƒ  } |  i	 i ƒ  } | i d d d d d ƒ} | | _ t d ƒ | _ d | _ | i d d d d d ƒ} t | _ | | _ t d ƒ | _ d | _ | i d d d d d ƒ} | | _ | i d	 d d d d ƒ} | | _ t d ƒ | _ d | _ | |  _ | |  _ |  i d g ƒ |  i	 i d g ƒ |  i	 i d ƒ t  i! | ƒ |  _" |  i	 i ƒ  } |  i" i d d d d d ƒ} | | _ t d ƒ | _ d | _ | |  _# t
 i d | ƒ |  i	 i d  ƒ t  i! |  i" ƒ |  _$ |  i	 i ƒ  } |  i$ d } | | _ t% | _ | |  _& d  S(!   Ns   hg/s   hg/as   hg/bs   hg/dir/s   hg/dir/cRÅ   t   at   bs   dir/ct   fooRí   R:   R7   s   hg:as   contents of hg/a
t(   72bcea9d6cba6ee7d3241bfa0c5e54506ad81a94s   hg:bs   contents of hg/b
t(   b4d0c22d126cd0afeeeffa62961fb47c0932835aRj   R6   s   hg:dirs   hg:dir:cs   contents of hg/dir/c
t(   958be752affac0fee70471331b96fb3fc1809425s   hg/dir/ds   dir/dt   bars   hg:dir:ds   contents of hg/dir/d
t(   f48fc342f707bfb4711790e1813c0df4d44e1a23s   reset mode on b('   t   superRü   R	   t   setUpt
   build_treeR³   R¨   R   R¹   t   treeR8   t   lstatt   st_modet   modet   chmodt   statt   S_IEXECR)   R›   RL   t   revone_inventoryR   R€   RB   RC   Ri   R&   Rc   Rf   Rg   Rh   t   revidonet   copyt   deepcopyt   revtwo_inventoryt   revidtwot   revthree_inventoryRº   t
   revidthree(   R	   R€   R   R  RC   R  (    (    R   R  o  s`    																c         C   s¦   |  i i i } |  i } | i |  i ƒ } |  i
 | i | i ƒ |  i } | i |  i ƒ } |  i
 | i | i ƒ |  i } | i |  i ƒ } |  i
 | i | i ƒ d  S(   N(   R	   R  Rž   R|   t   repoR  t   leftRm   R  t   rightt   assertEqualt   _byidR  R  R  R  (   R	   R  R  R  (    (    R   t   test_inventory_from_manifest§  s    			c         C   sº   |  i i i i |  i ƒ } |  i g  | i ƒ |  i h  | i	 ƒ |  i d | i
 ƒ |  i |  i | i ƒ |  i d | i ƒ |  i d  | i ƒ |  i d  | i ƒ |  i d  | i ƒ d  S(   NRÿ   R5   (   R	   R  Rž   R|   Rx   R  t   converted_revR  Rq   t
   propertiesRs   R   Rt   t   assertNotEqualR   Rv   Ru   Rw   (   R	   R  (    (    R   t$   test_initial_revision_from_changelog³  s    c         C   sÀ   |  i i i i |  i ƒ } |  i |  i g | i	 ƒ |  i h  | i
 ƒ |  i d | i ƒ |  i |  i | i ƒ |  i d | i ƒ |  i d  | i ƒ |  i d  | i ƒ |  i d  | i ƒ d  S(   NR  R5   (   R	   R  Rž   R|   Rx   R  R  R  R  Rq   R  Rs   R   Rt   R  R   Rv   Ru   Rw   (   R	   R  (    (    R   t(   test_non_initial_revision_from_changelogÀ  s    c         C   sg   |  i |  i i i i |  i ƒ ƒ |  i |  i i i i |  i ƒ ƒ |  i |  i i i i d ƒ ƒ d  S(   NRÿ   (	   R	   t
   assertTrueR  Rž   R|   Rz   R  R  t   assertFalse(   R	   (    (    R   t   test_has_revisionÍ  s    ""c         C   sV   |  i d ƒ } | i |  i i ƒ |  i d d ƒ |  i d d ƒ |  i d d ƒ d  S(   Nt   bzrs   contents of hg/a
s   bzr/as   contents of hg/b
s   bzr/bs   contents of hg/dir/c
s	   bzr/dir/c(   R	   t   make_branch_and_treet   bzrtreeR©   R  Rž   t   assertFileEqual(   R	   R'  (    (    R   t   test_pull_into_bzrÒ  s
    (	   R   R   R   R  R  R   R!  R$  R)  (    (    (    R   Rü   l  s    	8				(?   R   R  R8   R  t   mercurial.commandsR[   t   mercurial.hgt   mercurial.nodeR   R   t   mercurial.uit   bzrlib.branchRÝ   t   bzrlib.bzrdirt   bzrlib.decoratorst   bzrlib.errorsR®   t   bzrlib.inventoryRL   t   bzrlib.lockable_filest   bzrlib.osutilsRñ   Re   t   bzrlib.repositoryt   bzrlib.revisionRn   t   bzrlib.testsRù   t   TestCaseWithTransportt   bzrlib.transport.localt   LocalTransportt   bzrlib.tsortRØ   t   bzrlib.workingtreeR   R   t   objectR   t   lockable_filest   LockableFilesR   R|   t
   RepositoryR   Rž   t   BranchR{   t   workingtreet   WorkingTreeR   R   t   BzrDirRˆ   t   BzrDirFormatR³   t   register_control_formatt	   ConverterR½   t   InterRepositoryRÎ   t   register_optimiserRû   Rü   (   Rñ   RØ   R   Rü   RL   R{   Rn   R½   R®   R   R   R   R   Rù   R   R  R   Re   RÎ   R8  R  R:  R³   R[   Rˆ   Rû   R   R8   RÝ   (    (    R   t   ?   sH   														
Ä,#D4|	