^cdZddlmZddlmZmZmZmZmZdZ iZ ej e Z e e ddge e dde e d d iZ ej e Z d Zd Z ddZdZdZddZdZdZd S)a?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 )_) bookmarkscommandserror extensions registrarsbookflowprotect@require-bookmarkTenable-branchesFc |jj}|r||tdvr$t jt d|zt||s3t jt dt d|zn=|tddr!t jt dd S) Nr s'cannot commit, bookmark %s is protectedsAcannot commit, working directory out of sync with active bookmarksrun 'hg up %s'hintr Ts(cannot commit without an active bookmarkr) _bookmarksactive configlistMY_NAMErAbortrcwd_at_bookmark configbool)uirepokwargsrs 0/usr/lib/python3/dist-packages/hgext/bookflow.py commit_hookr's _ #F J R]]7J77 7 7+<==F tV,, +X())F2    w 3T : :Jk!GHHIII 1cFt|dkr ||||SdS)NF)len)origrparentsnodes rbookmarks_updater#:s. 7||qtD'4(((urNc|s4|j}|D]*}||vr$tjtd|z+|||||||S)Ns8bookmark %s already exists, to move use the --rev option)rrrr) r rtrnamesrevforceinactivemarksnames rbookmarks_addbookmarksr,Csz    Du}}kS 4b%eX 6 66rc<t|||||g|Ri|SN)r)r rrargsoptss rcommands_commitr1Ss4D 4D (4 ( ( (4 ( ((rc|||g|Ri|}|jj}|r5t||s%|t d|z|S)NsBworking directory out of sync with active bookmark, run 'hg up %s')rrrwarnr)r rrr/r0rcrs r commands_pullr5Xs b$ & & & & & &B _ #F  odF33           Irc |rM|ds8|ds#tjtdd||||fi|S)Ncleanr's@creating named branches is disabled and you should use bookmarksssee 'hg help bookflow'r)getrrr)r rrlabelr0s rcommands_branchr:fsz  TXXg&& txx k S  +     4D% ( (4 ( ((rcR|j|}|d}||kS)N.)rlookup)rmarkmark_idcur_ids rrrqs*od#G [[  F W rctjtdttjtdttjt jdttjt jdt| tds'tjt jdtdSdS)Nsupdates addbookmarksscommitspullr sbranch) r wrapfunctionrr#r, wrapcommandrtabler1r5rrr:)rs ruisetuprEwsIy2BCCCI8NOOO8>9oFFF8>7MBBB =="4 5 5Kx~y/JJJJJKKr)NFFr.)__doc__mercurial.i18nr mercurialrrrrrr configtable configitemcmdtablecommandrr#r,r1r5r:rrErrrNsu   !Y !+ . . 7J''' 7'... 7&...  ) H % %   &