def set_revision_info(self, revision, log, text): if destroy['data']: if revision == self.head_revision: # Set the HEAD text unconditionally. (It could be # that revision HEAD-1 has an empty deltatext, in # which case the HEAD text was actually committed in # an earlier commit.) text = ('This text was last seen in HEAD (revision %s)\n') % ( revision, ) elif text == '': # This is a no-op revision; preserve that fact. (It # might be relied on by cvs2svn). pass else: # Otherwise, replace the data. if revision.count('.') == 1: # On trunk, it could be that revision N-1 has an # empty deltatext, in which case text for revision # N was actually committed in an earlier commit. text = ('d1 1\n' 'a1 1\n' 'This text was last seen in revision %s\n') % ( revision, ) else: # On a branch, we know that the text was changed # in revision N (even though the same text might # also be kept across later revisions N+1 etc.) text = ('d1 1\n' 'a1 1\n' 'This text was committed in revision %s\n') % ( revision, ) if destroy['metadata'] or destroy['symbols'] or destroy['filenames']: log = self.log_substituter.get_substitution(log) FilterSink.set_revision_info(self, revision, log, text)
def define_revision( self, revision, timestamp, author, state, branches, next ): if destroy['metadata']: author = self.author_substituter.get_substitution(author) FilterSink.define_revision( self, revision, timestamp, author, state, branches, next )
def define_revision(self, revision, timestamp, author, state, branches, next): revision = self.transform_rev(revision) branches = [self.transform_rev(b) for b in branches] if next is not None: next = self.transform_rev(next) FilterSink.define_revision(self, revision, timestamp, author, state, branches, next)
def define_revision( self, revision, timestamp, author, state, branches, next ): revision = self.transform_rev(revision) branches = [self.transform_rev(b) for b in branches] if next is not None: next = self.transform_rev(next) FilterSink.define_revision( self, revision, timestamp, author, state, branches, next )
def __init__(self, sink, transform_revision_func): '''Constructor. SINK is the object we're wrapping. It must implement the cvs2svn_rcsparse.Sink interface. TRANSFORM_REVISION_FUNC is a function that takes a single CVS revision number, as a string, and returns the possibly-transformed revision number in the same format. ''' FilterSink.__init__(self, sink) self.transform_rev = transform_revision_func
def set_revision_info(self, revision, log, text): if destroy['data']: if revision == self.head_revision: # Set the HEAD text unconditionally. (It could be # that revision HEAD-1 has an empty deltatext, in # which case the HEAD text was actually committed in # an earlier commit.) text = ( 'This text was last seen in HEAD (revision %s)\n' ) % (revision,) elif text == '': # This is a no-op revision; preserve that fact. (It # might be relied on by cvs2svn). pass else: # Otherwise, replace the data. if revision.count('.') == 1: # On trunk, it could be that revision N-1 has an # empty deltatext, in which case text for revision # N was actually committed in an earlier commit. text = ( 'd1 1\n' 'a1 1\n' 'This text was last seen in revision %s\n' ) % (revision,) else: # On a branch, we know that the text was changed # in revision N (even though the same text might # also be kept across later revisions N+1 etc.) text = ( 'd1 1\n' 'a1 1\n' 'This text was committed in revision %s\n' ) % (revision,) if destroy['metadata'] or destroy['symbols'] or destroy['filenames']: log = self.log_substituter.get_substitution(log) FilterSink.set_revision_info(self, revision, log, text)
def __init__(self, author_substituter, log_substituter, sink): FilterSink.__init__(self, sink) self.author_substituter = author_substituter self.log_substituter = log_substituter
def set_head_revision(self, revision): self.head_revision = revision FilterSink.set_head_revision(self, revision)
def set_principal_branch(self, branch_name): FilterSink.set_principal_branch(self, self.transform_rev(branch_name))
def set_revision_info(self, revision, log, text): FilterSink.set_revision_info(self, self.transform_rev(revision), log, text)
def define_tag(self, name, revision): FilterSink.define_tag(self, name, self.transform_rev(revision))
def set_description(self, description): if destroy['metadata']: description = '' FilterSink.set_description(self, description)
def set_revision_info(self, revision, log, text): if destroy['data']: text = '' if destroy['metadata'] or destroy['symbols'] or destroy['filenames']: log = self.log_substituter.get_substitution(log) FilterSink.set_revision_info(self, revision, log, text)
def define_revision(self, revision, timestamp, author, state, branches, next): if destroy['metadata']: author = self.author_substituter.get_substitution(author) FilterSink.define_revision(self, revision, timestamp, author, state, branches, next)
def define_tag(self, name, revision): if destroy['symbols']: name = rewrite_symbol(name) FilterSink.define_tag(self, name, revision)
def set_head_revision(self, revision): FilterSink.set_head_revision(self, self.transform_rev(revision))