
    6h                       S r SSKJr  SSKJr  SSKJrJrJrJ	r	J
r
  Sr0 r\
R                  " \5      r\" \SS/5        \" \SS	5        \" \S
S5        0 r\
R                  " \5      rS rS r SS jrS rS rSS jrS rS rg)a9  implements bookmark-based branching (EXPERIMENTAL)

- Disables creation of new branches (config: enable_branches=False).
- Requires an active bookmark on commit (config: require_bookmark=True).
- Doesn't move the active bookmark on update, only on commit.
- Requires '--rev' for moving an existing bookmark.
- Protects special bookmarks (config: protect=@).

flow related commands

    :hg book NAME: create a new bookmark
    :hg book NAME -r REV: move bookmark to revision (fast-forward)
    :hg up|co NAME: switch to bookmark
    :hg push -B .: push active bookmark
    )annotations)_)	bookmarkscommandserror
extensions	registrars   bookflow   protect   @   require-bookmarkT   enable-branchesFc                   UR                   R                  nU(       aw  X0R                  [        S5      ;   a"  [        R
                  " [        S5      U-  5      e[        X5      (       d*  [        R
                  " [        S5      [        S5      U-  S9e g	U R                  [        SS5      (       a  [        R
                  " [        S5      5      eg	)
Nr
   s'   cannot commit, bookmark %s is protectedsA   cannot commit, working directory out of sync with active bookmarks   run 'hg up %s'hintr   Ts(   cannot commit without an active bookmarkr   )	
_bookmarksactive
configlistMY_NAMEr   Abortr   cwd_at_bookmark
configbool)uirepokwargsr   s       0/usr/lib/python3/dist-packages/hgext/bookflow.pycommit_hookr   )   s    __##F]]7J77++<=F  t,,++X ()F2	  -  
w 3T	:	:kk!GHII    c                4    [        U5      S:X  a	  U " XU5      $ g)N   F)len)origr   parentsnodes       r   bookmarks_updater$   <   s     
7|qD4(( r   Nc                    U(       d<  UR                   nU H*  nX;   d  M
  [        R                  " [        S5      U-  5      e   U " XX4XV5      $ )Ns8   bookmark %s already exists, to move use the --rev option)r   r   r   r   )	r!   r   trnamesrevforceinactivemarksnames	            r   bookmarks_addbookmarksr-   E   sV     D}kkS    %e66r   c                0    [        X5        U " X/UQ70 UD6$ N)r   )r!   r   r   argsoptss        r   commands_commitr2   U   s    (4(4((r   c                    U " X/UQ70 UD6nUR                   R                  nU(       a-  [        X&5      (       d  UR                  [	        S5      U-  5        U$ )NsB   working directory out of sync with active bookmark, run 'hg up %s')r   r   r   warnr   )r!   r   r   r0   r1   rcr   s          r   commands_pullr6   Z   s\    	b	&	&	&B__##Fod33
 		
 Ir   c                    U(       aJ  UR                  S5      (       d4  UR                  S5      (       d  [        R                  " [        S5      SS9eU " XU40 UD6$ )Ncleanr(   s@   creating named branches is disabled and you should use bookmarkss   see 'hg help bookflow'r   )getr   r   r   )r!   r   r   labelr1   s        r   commands_branchr;   h   sT    TXXg&&txxkkS +	
 	
 %(4((r   c                J    U R                   U   nU R                  S5      nX2:H  $ )N   .)r   lookup)r   markmark_idcur_ids       r   r   r   s   s'    ood#G[[Fr   c                   [         R                  " [        S[        5        [         R                  " [        S[        5        [         R
                  " [        R                  S[        5        [         R
                  " [        R                  S[        5        U R                  [        S5      (       d+  [         R
                  " [        R                  S[        5        g g )Nupdateaddbookmarkss   commits   pullr   s   branch)r   wrapfunctionr   r$   r-   wrapcommandr   tabler2   r6   r   r   r;   )r   s    r   uisetuprH   y   s    Ix1ABI~7MN8>>9oF8>>7MB=="455x~~y/J 6r   )NFFr/   )__doc__
__future__r   mercurial.i18nr   	mercurialr   r   r   r   r	   r   configtable
configitemcmdtablecommandr   r$   r-   r2   r6   r;   r   rH    r   r   <module>rR      s     #   !!+.
 
7J ' 
7' . 
7& .


H
%& <A7 )
)Kr   