Ejemplo n.º 1
0
    def test_multiple_vendor_imports_and_no_revisions_on_trunk(self):
        """Respect the 'branch' field in the RCS header.

        This file was imported twice into the vendor branch but never
        modified in the HEAD branch.

        The RCS file is from OpenBSD CVS (src/usr.sbin/nsd/LICENSE).
        """
        f = RCSFile(join(dirname(__file__), 'data', 'nsd', 'LICENSE,v'))
        self.assertEqual(['1.1.1.1', '1.1.1.2'], list(f.revisions()))
Ejemplo n.º 2
0
    def run(self):
        rcsfile = RCSFile(self.rcsfile)

        if self.options.checkout:
            return self.checkout(rcsfile, self.options.checkout)

        print 'Head: %s' % rcsfile.head
        print 'Branch: %s' % rcsfile.branch
        print 'Revision trail:',
        for revision in rcsfile.revisions():
            print revision,
        print ''
        for change in rcsfile.changes():
            rcsfile._print_revision(change.revision)
Ejemplo n.º 3
0
    def test_keyword_substitution_edge_cases(self):
        """Test edge cases where RCS keyword expansion might fail.
        """
        blob = self.checkout('dot.commonutils,v', '1.1')
        s = '$Id: dot.commonutils,v 1.1 1995/10/18 08:37:54 deraadt Exp $'
        self.assertEqual(1651, blob.find(s))

        blob = self.checkout('res_query.c,v', '1.1')
        s = '$Id: res_query.c,v 1.1 1993/06/01 09:42:14 vixie Exp vixie "'
        self.assertEqual(3091, blob.find(s))

        blob = self.checkout('setjmp.h,v', '1.2')
        s = '$OpenBSD: setjmp.h,v 1.2 2001/03/29 18:52:19 drahn Exp $'
        self.assertEqual(3, blob.find(s))

        blob = self.checkout('test_cvs_import_01_seed1.txt,v,v', '1.1')
        s = '$Id: seed1.txt,v 1.1 2007/06/05 05:49:41 niallo Exp $'
        self.assertEqual(347, blob.find(s))

        f = RCSFile(join(dirname(__file__), 'data', 'pathnames.h,v'))
        self.assertEqual(list(f.revisions())[-1], '1.1.1.1')