Example #1
0
    def test_get_log2(self):
        # Get an interesting commmit.
        self.test_commit3()
        rev = fs.youngest_rev(self.fs)
        revprops = ra.rev_proplist(self.ra_ctx, rev)
        self.assert_("svn:log" in revprops)
        self.assert_("testprop" in revprops)

        def receiver(log_entry, pool):
            called[0] = True
            self.assertEqual(log_entry.revision, rev)
            if discover_changed_paths:
                self.assertEqual(list(log_entry.changed_paths.keys()),
                                 ['/bla3'])
                changed_path = log_entry.changed_paths['/bla3']
                self.assert_(changed_path.action in ['A', 'D', 'R', 'M'])
                self.assertEqual(changed_path.copyfrom_path, None)
                self.assertEqual(changed_path.copyfrom_rev, -1)
            else:
                self.assertEqual(log_entry.changed_paths, None)
            if log_revprops is None:
                self.assertEqual(log_entry.revprops, revprops)
            elif len(log_revprops) == 0:
                self.assert_(log_entry.revprops == None
                             or len(log_entry.revprops) == 0)
            else:
                revprop_names = sorted(log_entry.revprops.keys())
                log_revprops.sort()
                self.assertEqual(revprop_names, log_revprops)
                for i in log_revprops:
                    self.assertEqual(log_entry.revprops[i],
                                     revprops[i],
                                     msg="%s != %s on %s" %
                                     (log_entry.revprops[i], revprops[i],
                                      (log_revprops, discover_changed_paths)))

        for log_revprops in (
                # Retrieve the standard three.
            ["svn:author", "svn:date", "svn:log"],
                # Retrieve just testprop.
            ["testprop"],
                # Retrieve all.
                None,
                # Retrieve none.
            [],
        ):
            for discover_changed_paths in [True, False]:
                called = [False]
                ra.get_log2(
                    self.ra_ctx,
                    [""],
                    rev,
                    rev,  # start, end
                    1,  # limit
                    discover_changed_paths,
                    True,  # strict_node_history
                    False,  # include_merged_revisions
                    log_revprops,
                    receiver)
                self.assert_(called[0])
Example #2
0
File: ra.py Project: Ranga123/test1
    def test_get_log2(self):
        # Get an interesting commmit.
        self.test_commit3()
        rev = fs.youngest_rev(self.fs)
        revprops = ra.rev_proplist(self.ra_ctx, rev)
        self.assert_("svn:log" in revprops)
        self.assert_("testprop" in revprops)

        def receiver(log_entry, pool):
            called[0] = True
            self.assertEqual(log_entry.revision, rev)
            if discover_changed_paths:
                self.assertEqual(list(log_entry.changed_paths.keys()), ["/bla3"])
                changed_path = log_entry.changed_paths["/bla3"]
                self.assert_(changed_path.action in ["A", "D", "R", "M"])
                self.assertEqual(changed_path.copyfrom_path, None)
                self.assertEqual(changed_path.copyfrom_rev, -1)
            else:
                self.assertEqual(log_entry.changed_paths, None)
            if log_revprops is None:
                self.assertEqual(log_entry.revprops, revprops)
            elif len(log_revprops) == 0:
                self.assert_(log_entry.revprops == None or len(log_entry.revprops) == 0)
            else:
                revprop_names = sorted(log_entry.revprops.keys())
                log_revprops.sort()
                self.assertEqual(revprop_names, log_revprops)
                for i in log_revprops:
                    self.assertEqual(
                        log_entry.revprops[i],
                        revprops[i],
                        msg="%s != %s on %s"
                        % (log_entry.revprops[i], revprops[i], (log_revprops, discover_changed_paths)),
                    )

        for log_revprops in (
            # Retrieve the standard three.
            ["svn:author", "svn:date", "svn:log"],
            # Retrieve just testprop.
            ["testprop"],
            # Retrieve all.
            None,
            # Retrieve none.
            [],
        ):
            for discover_changed_paths in [True, False]:
                called = [False]
                ra.get_log2(
                    self.ra_ctx,
                    [""],
                    rev,
                    rev,  # start, end
                    1,  # limit
                    discover_changed_paths,
                    True,  # strict_node_history
                    False,  # include_merged_revisions
                    log_revprops,
                    receiver,
                )
                self.assert_(called[0])