Comment #6 on issue 2294 by [email protected]: Unable to parse diff revision header when adding cvs diff with new files
http://code.google.com/p/reviewboard/issues/detail?id=2294

Because of various changes, I have not used reviewboard for around 2 years. The patch I was using was on one old HDD, from which I got part of the information recently... I see this is fixed now, but if it happens to be of interest at some pint, I am pasting a couple of notes from one text file describing the patch we have applied at that time:

"
3. Change in cvs.py that fixes a problem with new files:

    rev_re_new = re.compile(r'^.*?\r?$')
    rev_re = re.compile(r'^.*?(\d+(\.\d+)+)\r?$')
repopath_re = re.compile(r'^(?P<hostname>.*):(?P<port>\d+)?(?P<path>.*)')
    ext_cvsroot_re = re.compile(r':ext:([^@]+@)?(?P<hostname>[^:/]+)')

    def __init__(self, repository):
        SCMTool.__init__(self, repository)

        self.cvsroot, self.repopath = \
            self.build_cvsroot(self.repository.path,
                               self.repository.username,
                               self.repository.password)
        self.client = CVSClient(self.cvsroot, self.repopath)

    def get_file(self, path, revision=HEAD):
        if not path:
            raise FileNotFoundError(path, revision)

        return self.client.cat_file(path, revision)

    def parse_diff_revision(self, file_str, revision_str):
        if revision_str == "PRE-CREATION":
            return file_str, PRE_CREATION

        m = self.rev_re.match(revision_str)
        if not m:
            m2 = self.rev_re_new.match(revision_str)
            if m2:
                return file_str, PRE_CREATION
            raise SCMError("Unable to parse diff revision header '%s'" %
                           revision_str)

4.In diffutils.py

line 220:

change:

    p = subprocess.Popen(['patch', '-o', newfile, oldfile],
                         stdin=subprocess.PIPE, stdout=subprocess.PIPE,
                         stderr=subprocess.STDOUT)

with

    p = subprocess.Popen(['patch', '-l', '-o', newfile, oldfile],
                         stdin=subprocess.PIPE, stdout=subprocess.PIPE,
                         stderr=subprocess.STDOUT)
"

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"reviewboard-issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/reviewboard-issues.
For more options, visit https://groups.google.com/d/optout.

Reply via email to