Package buildslave :: Package commands :: Module git :: Class Git
[frames] | no frames]

Class Git

source code

      base.Command --+    
                     |    
base.SourceBaseCommand --+
                         |
                        Git

Git specific VC operation. In addition to the arguments
handled by SourceBaseCommand, this command reads the following keys:

['repourl'] (required):    the upstream GIT repository string
['branch'] (optional):     which version (i.e. branch or tag) to
                           retrieve. Default: "master".
['submodules'] (optional): whether to initialize and update
                           submodules. Default: False.
['ignore_ignores']:        ignore ignores when purging changes.
['reference'] (optional):  use this reference repository to fetch objects

Instance Methods
 
setup(self, args)
Override this in a subclass to extract items from the args dict.
source code
 
sourcedirIsUpdateable(self)
Returns True if the tree can be updated.
source code
 
sourcedataMatches(self) source code
 
maybeNotDoVCFallback(self, res)
Override this in a subclass if you want to detect unrecoverable checkout errors where clobbering the repo wouldn't help, and stop the current VC chain before it clobbers the repo for future builds.
source code
 
doVCUpdate(self)
Returns a deferred with the steps to update a checkout.
source code
 
doVCFull(self)
Returns a deferred with the steps to do a fresh checkout.
source code
 
parseGotRevision(self)
Override this in a subclass.
source code

Inherited from base.SourceBaseCommand: doClobber, doClobberTryChmodIfFail, doCopy, doPatch, doVC, doVCFallback2, getCommand, interrupt, maybeClobber, maybeDoVCFallback, maybeDoVCRetry, readSourcedata, sourcedirIsPatched, start, writeSourcedata

Inherited from base.Command: __init__, __providedBy__, doInterrupt, doStart, sendStatus

Class Variables
  header = 'git operation'

Inherited from base.SourceBaseCommand: sourcedata

Inherited from base.Command: __implemented__, __provides__, debug, interrupted, running

Method Details

setup(self, args)

source code 

Override this in a subclass to extract items from the args dict.

Overrides: base.Command.setup
(inherited documentation)

sourcedirIsUpdateable(self)

source code 

Returns True if the tree can be updated.

Overrides: base.SourceBaseCommand.sourcedirIsUpdateable
(inherited documentation)

sourcedataMatches(self)

source code 
Overrides: base.SourceBaseCommand.sourcedataMatches

maybeNotDoVCFallback(self, res)

source code 

Override this in a subclass if you want to detect unrecoverable checkout errors where clobbering the repo wouldn't help, and stop the current VC chain before it clobbers the repo for future builds.

Use 'raise AbandonChain' to pass up a halt if you do detect such.

Overrides: base.SourceBaseCommand.maybeNotDoVCFallback
(inherited documentation)

doVCUpdate(self)

source code 

Returns a deferred with the steps to update a checkout.

Overrides: base.SourceBaseCommand.doVCUpdate
(inherited documentation)

doVCFull(self)

source code 

Returns a deferred with the steps to do a fresh checkout.

Overrides: base.SourceBaseCommand.doVCFull
(inherited documentation)

parseGotRevision(self)

source code 

Override this in a subclass. It should return a string that represents which revision was actually checked out, or a Deferred that will fire with such a string. If, in a future build, you were to pass this 'got_revision' string in as the 'revision' component of a SourceStamp, you should wind up with the same source code as this checkout just obtained.

It is probably most useful to scan self.command.stdout for a string of some sort. Be sure to set keepStdout=True on the VC command that you run, so that you'll have something available to look at.

If this information is unavailable, just return None.

Overrides: base.SourceBaseCommand.parseGotRevision
(inherited documentation)