
    	^c%D                        d dl mZ d dlmZmZmZmZmZ d Zd Z	d Z
d Zd Zg dZe	e
eedZd0d
Z ed           ed          f ed           ed          fd ed           ed          f ed           ed          fd ed           ed          f ed           ed          fd ed           ed          f ed           ed          fd ed           ed          f ed           ed          fd ed          df ed          dfd ed           ed          f ed           ed          fd ed           ed          f ed           ed           fd ed!          df ed!          dfd ed"          df ed#           ed$          fdd%
Zd1d'Z	 d2d)Z	 d2d*Zd+ Zd, Zd- Zd. Zd/ ZdS )3   )_)	bookmarkserrorobsutilscmutilstackc                    | j         j        }| j         j        }| j         j        }t	                      }t           ||                    }|r|                                }t          j        |  ||                    }|s|	                     ||                     n0|D ]-}	|	D ](}
 ||
          }|dk    r|
                    |           ).||S )zReturn all changesets that may be a new parent for orphan `rev`.

    This function works fine on non-orphan revisions, it's just silly
    because there's no destination implied by obsolete markers, so
    it'll return nothing.
    )	changelognode
parentrevsrevsetlistpopr   successorssetsextendadd)repor   tonodeparentstorevdesttovisitrsuccsetsssndrs               4/usr/lib/python3/dist-packages/mercurial/destutil.pyorphanpossibledestinationr!      s     ^ Fn'GNE55D773<<  G
 %KKMM)$q		:: 	% NN771::&&&&  % % % %AqBRxx%  %& K    c                    d}| d         }|                                 }d}|                                r|                                st          j        | |                                          }|r5d |D             }|                     d|                                          }nd|                                 }|                                r(|                                 }|                                (|                                }|.t          j	        |           r| d                                         }||dfS )z9decide of an update destination from obsolescence markersNc                     g | ]	}|D ]}|
S  r%   ).0subr   s      r    
<listcomp>z"_destupdateobs.<locals>.<listcomp>I   s%    ???3??a!????r"   s   max(%ln)   .)
p1obsoletechildrenr   r   r   revsfirstr   isactivewdirparent)r   cleanr   wcr*   movemark
successorss          r    _destupdateobsr4   /   s   D	dB	BH	{{}} )R[[]] )+D"''))<<
  	 @?z???J 99[*55;;==DDB++-- UUWW ++-- 7799D	 <T B BDz((H4r"   c                 h    d}t          j        | j        |           \  }}|| j        |         }|||fS )z4decide on an update destination from active bookmarkN)r   calculateupdateui
_bookmarks)r   r0   r   
activemarkr2   s        r    _destupdatebookr:   Z   sA     D$4TWdCCJz*:%%r"   c                 D   | d         }dx}}|                                 }|r| d                                          }||                                 v rn|                     |          }|r(|                     d|                                          }t          j        |           r| d                                         }n\|dk    r<|                                s(|                     d                                          }n| d                                         }||dfS )z_decide on an update destination from current branch

    This ignores closed branch heads.
    Nr)      max(.::(%ln))s   defaults   max(head() and not closed()))	branch	branchmapbranchheadsr-   r.   r   r/   r   r*   )r   r0   r1   r2   r   currentbranchheadss          r    _destupdatebranchrB   d   s   
 
dBHtIIKKM ,T
))++((((  // 	>99-u55;;==D'-- 	)Dz((H	*	$	$RUUWW	$ yy899??AADz  4r"   c                    | d         }|                                 }d}||                                 v r|                     |d          }|s
J d            |                     d|                                          }|
J d            t          j        |           r| d                                         }n!|                     d          }|
J d	            ||dfS )
zCdecide on an update destination from closed heads in current branchNTcloseds    any branch has at least one headr<   s4   any revision has at least one descendant branch headr)   s   tips%   'tip' exists even in empty repository)	r=   r>   r?   r-   r.   r   r/   r   lookup)r   r0   r1   r@   r2   rA   r   s          r    _destupdatebranchfallbackrG      s    	dBIIKKMH((((  t <<999999yy)5117799B '-- 	)Dz((H {{6""!I4r"   )s	   evolutions   bookmarks   branchs   branchfallbackFc                     dx}x}}t           D ] }t          |         | |          \  }}}| n!| |                                         }|||fS )a"  destination for bare update operation

    return (rev, movemark, activemark)

    - rev: the revision to update to,
    - movemark: node to move the active bookmark from
                (cf bookmark.calculate update),
    - activemark: a bookmark to activate at the end of the update.
    N)destupdatestepsdestupdatestepmapr   )r   r0   r   r2   r9   stepr   s          r    
destupdaterL      sm     $('D'8j  %6t%<T5%I%I"h
E 
t*..

C*$$r"   sT   multiple matching bookmarks to merge - please merge with an explicit rev or bookmarks4   run 'hg heads' to see all heads, specify rev with -rsT   multiple matching bookmarks to rebase - please rebase to an explicit rev or bookmarks<   run 'hg heads' to see all heads, specify destination with -d)   merges   rebasesM   no matching bookmark to merge - please merge with an explicit rev or bookmarksM   no matching bookmark to rebase - please rebase to an explicit rev or bookmarks<   branch '%s' has %d heads - please merge with an explicit revs2   run 'hg heads .' to see heads, specify rev with -rs;   branch '%s' has %d heads - please rebase to an explicit revs:   run 'hg heads .' to see heads, specify destination with -ds8   heads are bookmarked - please merge with an explicit revs7   heads are bookmarked - please rebase to an explicit revs<   branch '%s' has one head - please merge with an explicit revs;   branch '%s' has one head - please rebase to an explicit revs   nothing to mergeNs   nothing to rebases   use 'hg update' insteads(   working directory not at a head revisions2   use 'hg update' or merge with an explicit revisions1   use 'hg update' or rebase to an explicit revisions   source set is emptys)   source set is rooted in multiple branchess.   rebaseset is rooted in multiple named branchess+   specify an explicit destination with --dest)
   toomanybookmarks   nootherbookmarks   toomanyheads   bookmarkedheads   nootherbranchheads   nootherheads   nootherheadsbehind
   notatheads   emptysourceset   multiplebranchessourcesetrM   c                    d}t          j        |           }| j        | j                 }t	          |          dk    r||d         k    r	|d         }n|d         }n~t	          |          dk    r,t
          d         |         \  }}t          j        ||          t	          |          dk    r,t
          d         |         \  }}t          j        ||          |J |S )z2find merge destination in the active bookmark caseN       r   rN   hintrO   )	r   headsforactiver8   _activebookmarklenmsgdestmerger   ManyMergeDestAbortNoMergeDestAbort)	r   action	sourceset	destspacer   bmheadscurheadmsgr\   s	            r    _destmergebookri     s    D&t,,God23G
7||qgaj  1:DD1:DD	W		 !45f=	T&s6666	W		 !45f=	T$St4444Kr"   Tc                    d}|L| | j                                                                                  g}| j                                         }n|s,t          d         |         \  }}t          j        ||          d}|                     d||          D ]\}	|D|	                                |k    r,t          d         |         \  }}t          j        ||          |	                                }]| 	                    |          }
| 
                    d||
          }|rj|sht          |                                           dk    rt          d         |         \  }}nt          d	         |         \  }}t          j        ||          t          | 
                    d
|
|                    }
t          | 
                    d|
                    }|$t          | 
                    d||                    }t          |          dk    rCt          d         |         \  }}||t          |
          dz   fz  }t          j        ||          |s|
rt          d         |         \  }}npt          |                                           dk    rt          d         |         \  }}||z  }n/|st          d         |         \  }}nt          d         |         \  }}t          j        ||          |d         }|J |S )z,find merge destination based on branch headsNrV   r[   s   roots(%ld::%ld)rW   s   %ld and %lnr   rT   rU   s   %ln - (%ld::)s   %ld - bookmark()s   %ld and %ldrP   rQ   rR   rS   rZ   )dirstater*   r   r=   r`   r   rb   r   ra   r?   r-   r_   rA   Abortr   )r   rc   rd   onheadcheckre   r   r=   rh   r\   ctxbheadsonheadnbhss                r    _destmergebranchrr   1  s    D$-**,,-11334	%%'' 	" !23F;	T$St444488.	9EE 	" 	"C!cjjllf&<&<()EFvN	T.s>>>>ZZ\\FFf%%FYY~y&99F *6 * tzz||!!$%:;FCIC$]3F;ICk#D))))$)),fi@@AAF		-v6677D DIIni>>??
4yy1}} !1&9	TFa((&s6666 
  
	>$%78@IC""$%:;FCIC6MCC 	> %%:;FCIC$_5f=IC$St4444AwKr"   c                     | j         rt          | |||          }nt          | ||||          }| |                                         S )zreturn the default destination for a merge

    (or raise exception about why it can't pick one)

    :action: the action being performed, controls emitted error message
    )rc   rd   re   )rc   rd   rm   re   )r^   ri   rr   r   )r   rc   rd   rm   re   r   s         r    	destmergert   z  si      
9	
 
 
  #
 
 
 :>>r"   c                     |                      dd          }|t          j        |          }n:|rt          j        ||g          }n!t          j        t          d                    |r|                                S dS )z0Default base revision to edit for `hg histedit`.s   histedits
   defaultrevNs0   config option histedit.defaultrev can't be empty)	configr   getstackr   revranger   ConfigErrorr   min)r7   r   defaultr-   s       r    desthisteditr|     s    ii]33G~d##	 
wi00ABB
 
 	
  xxzz4r"   c                 Z    t          j        |          }|r|                                nd S )N)r   rw   r.   )r7   r   r-   s      r    	stackbaser~     s(    >$D)4::<<<T)r"   c                    t          j        |          }|j        |j                 |                    d          rMfd|D             }|r?t          d          }|                     |t          |          |j        fz             d S d S d S )Ns   %n and parents()c                      g | ]
}|k    |S r%   r%   )r&   brg   s     r    r(   z$_statusotherbook.<locals>.<listcomp>  s    666A1r"   s&   %i other divergent bookmarks for "%s"
)r   r]   r8   r^   r-   r   statusr_   )r7   r   rf   rh   rg   s       @r    _statusotherbookr     s    &t,,God23Gyy$g.. B6666g666 	B>??CIIcS\\4+?@@AAAAAB B	B 	Br"   c                 J   |j                                         }|                    |d          }|                    |          }|                    d|          rD|                    d|          }|d                                         r|                     t          d          |z             |r4|                     t          d          t          |          z             d S |                     t          d          |z             d S |r|d         }|                     t          d	          ||	                                
                    d
          d         fz             |                     t          d          t          |          |fz             d S d S d S )NTrD   s   %ln and parents()s   %ln - parents()r)   sC   no open descendant heads on branch "%s", updating to a closed head
sJ   (committing will reopen the head, use 'hg heads .' to see %i other heads)
s%   (committing will reopen branch "%s")
s   updated to "%s: %s"
   
rZ   s   %i other heads for branch "%s"
)rk   r=   r?   r-   closesbranchwarnr   r_   r   descriptionsplit)r7   r   r@   allheadsrA   
otherheadsrg   s          r    _statusotherbranchheadsr     s   M((**Md;;H]++Eyy%x00 ( YY1599
:""$$ 	GG3   	     E  :	(     ?@@=P      		4jGII*++G//1177>>qABC   II566z??M23    K( (>		 		r"   c                 X    |j         rt          | |           dS t          | |           dS )zPrint message about other headN)r^   r   r   )r7   r   s     r    statusotherdestsr     s;    
  *T"""""D)))))r"   )F)rM   NN)rM   NTN)i18nr    r   r   r   r   r   r!   r4   r:   rB   rG   rI   rJ   rL   r`   ri   rr   rt   r|   r~   r   r   r   r%   r"   r    <module>r      su         7 7 7 7 7 7 7 7 7 7 7 7 7 7  D(  (  ( V& & &     6     0 LKK !  0	  % % % %2 AB  AEFF
 AA  AMNN
 & AA  AEFF
 A@  AMNN
 & AMNNACDD

 ALMMAKLL
	 	 AIJJAEFF

 AHIIAMNN
	 	 AMNNAEFF

 ALMMAMNN
	 	 1())40A*++T2  1())11-G+H+HIA*++QQ/I-J-JK  A9::ACDD

 A9::ABCC
	 	 1+,,d3A,--t4 
 1ABBDIA?@@A<==
# #{d dN   * HLF F F FT HL   4  (* * *
B B B, , ,^* * * * *r"   