³ņ KKc@s7ddkZddklZddkiZddklZddklZddk l Z ddk l Z ddk lZddklZdd klZlZdd klZdd klZd e fd „ƒYZde fd„ƒYZde fd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdeefd„ƒYZ deefd„ƒYZ!defd„ƒYZ"d e"efd!„ƒYZ#d"e"efd#„ƒYZ$d$efd%„ƒYZ%d&e%efd'„ƒYZ&d(e%efd)„ƒYZ'd*e fd+„ƒYZ(dS(,i’’’’N(t make_option(t parse_bug_id(t ChangeLog(tAbstractSequencedCommand(tbug_comment_from_commit_text(t ScriptError(t pluralize(terrortlog(tAbstractDeclarativeCommand(t StepSequencetBuildcBs,eZdZdZeieieigZRS(tbuildsUpdate working copy and build(t__name__t __module__tnamet help_texttstepstCleanWorkingDirectorytUpdateR (((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyR 0s t BuildAndTestcBs2eZdZdZeieieieigZRS(sbuild-and-tests-Update working copy, build, and run the tests( R RRRRRRR tRunTests(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyR:s tLandcBs_eZdZdZdZeZeiei eiei ei ei ei gZdZd„ZRS(tlandsMLand the current working directory diff and updates the associated bug if anys[BUGID]sėland commits the current working copy diff (just as svn or git commit would). land will build and run the tests before committing. If a bug id is provided, or one can be found in the ChangeLog land will update the bug after committing.cCsChhdd<|o |dpt|iƒiƒƒd<ds (cCs|ii||ƒdS(N(R9trun_and_handle_errors(RRR R!((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyR1†scCs)h|d<}|ii|||ƒdS(NR(R;R?(RRRR R!tstate((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyR4‰sN(R RRR8R:R>R1R4(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyR7{s   tProcessAttachmentsMixincBseZd„ZRS(cst‡fd†|ƒS(Ncsˆii|ƒS((tbugstfetch_attachment(tpatch_id(R!(sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyts(tmap(RRR R!((R!sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyR2s(R RR2(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyRAŽstProcessBugsMixincBseZd„ZRS(cCsZg}xM|D]E}|ii|ƒ}tdtdt|ƒƒ|fƒ||7}q W|S(Ns%s found on bug %s.sreviewed patch(RBtfetch_reviewed_patches_from_bugRRR3(RRR R!t all_patchesRR-((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyR2”s#(R RR2(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyRG“st CheckStylecBs8eZdZdZdZeieieiei gZ RS(s check-styles3Run check-webkit-style on the specified attachmentssATTACHMENT_ID [ATTACHMENT_IDS]( R RRRR#RRRt ApplyPatchRJR:(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyRJstBuildAttachmentcBs8eZdZdZdZeieieiei gZ RS(sbuild-attachments%Apply and build patches from bugzillasATTACHMENT_ID [ATTACHMENT_IDS]( R RRRR#RRRRKR R:(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyRL©stAbstractPatchApplyingCommandcBs2eZeieieigZeigZdZ RS(saUpdates the working copy. Downloads and applies the patches, creating local commits if necessary.( R RRtEnsureLocalCommitIfNeededt%CleanWorkingDirectoryWithLocalCommitsRR8tApplyPatchWithLocalCommitR:R*(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyRMµs   tApplyAttachmentcBs eZdZdZdZeZRS(sapply-attachments2Apply an attachment to the local working directorysATTACHMENT_ID [ATTACHMENT_IDS](R RRRR#R$R%(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyRQĀst ApplyFromBugcBs eZdZdZdZeZRS(sapply-from-bugsHApply reviewed patches from provided bugs to the local working directorysBUGID [BUGIDS](R RRRR#R$R%(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyRRÉstAbstractPatchLandingCommandc BsVeZeigZeieieieieiei ei ei ei g Z dZRS(sŁChecks to make sure builders are green. Updates the working copy. Applies the patch. Builds. Runs the layout tests. Commits the patch. Clears the flags on the patch. Closes the bug if no patches are marked for review.(R RRR&R8RRRKR RR(t ClosePatchtCloseBugR:R*(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyRSŠs  tLandAttachmentcBs eZdZdZdZeZRS(sland-attachmentsFLand patches from bugzilla, optionally building and testing them firstsATTACHMENT_ID [ATTACHMENT_IDS](R RRRR#R$R%(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyRVést LandFromBugcBs eZdZdZdZeZRS(s land-from-bugsNLand all patches on the given bugs, optionally building and testing them firstsBUGID [BUGIDS](R RRRR#R$R%(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyRWšstRolloutcBsneZdZeZdZdZdZei ei ei ei ei eieigZed„ƒZd„ZRS(trolloutskRevert the given revision in the working copy and optionally commit the revert and re-open the original bugsREVISION REASONsDUpdates the working copy. Applies the inverse diff for the provided revision. Creates an appropriate rollout ChangeLog, including a trac link and bug link. Opens the generated ChangeLogs in $EDITOR. Shows the prepared diff for confirmation. Commits the revert and updates the bug (including re-opening the bug if necessary).cCs|iƒi|ƒ}t|ƒS(N(Rtdiff_for_revisionR(R!trevisiont original_diff((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyt _parse_bug_id_from_revision_diff scCs’|d}|d}|i||ƒ}|io'|otd|ƒqWtdƒnh|d<|d<|d<}|ii|||ƒdS(Niis"Will re-open bug %s after rollout.sZFailed to parse bug number from diff. No bugs will be updated/reopened after the rollout.R[Rtreason(R]tcomplete_rolloutRt _sequenceR?(RRR R!R[R^RR@((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyR5s      (R RRR$R%RR#R*RRRtRevertRevisiontPrepareChangeLogForRevertt EditChangeLogt ConfirmDifftCompleteRolloutR6R]R5(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyRX÷s ()tostoptparseRtwebkitpy.stepsRtwebkitpy.bugzillaRtwebkitpy.changelogsRt*webkitpy.commands.abstractsequencedcommandRtwebkitpy.commentsRtwebkitpy.executiveRtwebkitpy.grammarRtwebkitpy.webkit_loggingRRtwebkitpy.multicommandtoolR twebkitpy.stepsequenceR R RRR+R7tobjectRARGRJRLRMRQRRRSRVRWRX(((sT/usr/local/google/WebKitToT/WebKit/WebKitTools/Scripts/webkitpy/commands/download.pyss6