Skip to content

Commit

Permalink
Add clone method to sourcestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
hborkhuis committed May 8, 2012
1 parent 25a918a commit 4ec9465
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions master/buildbot/sourcestamp.py
Expand Up @@ -217,13 +217,19 @@ def mergeWith(self, others):
changes=changes)
return newsource

def getAbsoluteSourceStamp(self, got_revision):
return SourceStamp(branch=self.branch, revision=got_revision,
def clone(self):
# Create an exact but identityless copy
return SourceStamp(branch=self.branch, revision=self.revision,
patch=self.patch, repository=self.repository,
codebase=self.codebase, patch_info=self.patch_info,
project=self.project, changes=self.changes,
_ignoreChanges=True)

def getAbsoluteSourceStamp(self, got_revision):
cloned = self.clone()
cloned.revision = got_revision
return cloned

def getText(self):
# note: this won't work for VC systems with huge 'revision' strings
text = []
Expand Down Expand Up @@ -313,7 +319,6 @@ def get_setid():
return defer.succeed( sourcestampsetid )
else:
return master.db.sourcestampsets.addSourceStampSet()
return d

def set_setid(setid):
self.sourcestampsetid = setid
Expand Down

0 comments on commit 4ec9465

Please sign in to comment.