コード例 #1
0
ファイル: repo.py プロジェクト: ols3er/dulwich
    def fetch_pack_data(self,
                        determine_wants,
                        graph_walker,
                        progress,
                        get_tagged=None,
                        depth=None):
        """Fetch the pack data required for a set of revisions.

        :param determine_wants: Function that takes a dictionary with heads
            and returns the list of heads to fetch.
        :param graph_walker: Object that can iterate over the list of revisions
            to fetch and has an "ack" method that will be called to acknowledge
            that a revision is present.
        :param progress: Simple progress function that will be called with
            updated progress strings.
        :param get_tagged: Function that returns a dict of pointed-to sha ->
            tag sha for including tags.
        :param depth: Shallow fetch depth
        :return: count and iterator over pack data
        """
        # TODO(jelmer): Fetch pack data directly, don't create objects first.
        objects = self.fetch_objects(determine_wants,
                                     graph_walker,
                                     progress,
                                     get_tagged,
                                     depth=depth)
        return pack_objects_to_data(objects)
コード例 #2
0
    def add_objects(self, objects):
        """Add a set of objects to this object store.

        :param objects: Iterable over (object, path) tuples, should support
            __len__.
        :return: Pack object of the objects written.
        """
        return self.add_pack_data(*pack_objects_to_data(objects))
コード例 #3
0
ファイル: object_store.py プロジェクト: atbradley/dulwich
    def add_objects(self, objects):
        """Add a set of objects to this object store.

        :param objects: Iterable over (object, path) tuples, should support
            __len__.
        :return: Pack object of the objects written.
        """
        return self.add_pack_data(*pack_objects_to_data(objects))
コード例 #4
0
    def add_objects(self, objects, progress=None):
        """Add a set of objects to this object store.

        Args:
          objects: Iterable over (object, path) tuples, should support
            __len__.
        Returns: Pack object of the objects written.
        """
        return self.add_pack_data(*pack_objects_to_data(objects), progress=progress)
コード例 #5
0
    def generate_pack_data(self, have, want, progress=None, ofs_delta=True):
        """Generate pack data objects for a set of wants/haves.

        :param have: List of SHA1s of objects that should not be sent
        :param want: List of SHA1s of objects that should be sent
        :param ofs_delta: Whether OFS deltas can be included
        :param progress: Optional progress reporting method
        """
        # TODO(user): More efficient implementation
        return pack_objects_to_data(
            self.generate_pack_contents(have, want, progress))
コード例 #6
0
ファイル: object_store.py プロジェクト: jelmer/dulwich
    def generate_pack_data(self, have, want, progress=None, ofs_delta=True):
        """Generate pack data objects for a set of wants/haves.

        :param have: List of SHA1s of objects that should not be sent
        :param want: List of SHA1s of objects that should be sent
        :param ofs_delta: Whether OFS deltas can be included
        :param progress: Optional progress reporting method
        """
        # TODO(jelmer): More efficient implementation
        return pack_objects_to_data(
            self.generate_pack_contents(have, want, progress))
コード例 #7
0
ファイル: object_store.py プロジェクト: tpow/breezy
 def generate_lossy_pack_data(self,
                              have,
                              want,
                              progress=None,
                              get_tagged=None,
                              ofs_delta=False):
     return pack_objects_to_data(
         self.generate_pack_contents(have,
                                     want,
                                     progress,
                                     get_tagged,
                                     lossy=True))
コード例 #8
0
    def generate_pack_data(self, have, want, shallow=None, progress=None,
                           ofs_delta=True):
        """Generate pack data objects for a set of wants/haves.

        Args:
          have: List of SHA1s of objects that should not be sent
          want: List of SHA1s of objects that should be sent
          shallow: Set of shallow commit SHA1s to skip
          ofs_delta: Whether OFS deltas can be included
          progress: Optional progress reporting method
        """
        # TODO(jelmer): More efficient implementation
        return pack_objects_to_data(
            self.generate_pack_contents(have, want, shallow, progress))
コード例 #9
0
    def fetch_pack_data(self, determine_wants, graph_walker, progress,
                        get_tagged=None):
        """Fetch the pack data required for a set of revisions.

        :param determine_wants: Function that takes a dictionary with heads
            and returns the list of heads to fetch.
        :param graph_walker: Object that can iterate over the list of revisions
            to fetch and has an "ack" method that will be called to acknowledge
            that a revision is present.
        :param progress: Simple progress function that will be called with
            updated progress strings.
        :param get_tagged: Function that returns a dict of pointed-to sha ->
            tag sha for including tags.
        :return: count and iterator over pack data
        """
        # TODO(jelmer): Fetch pack data directly, don't create objects first.
        objects = self.fetch_objects(determine_wants, graph_walker, progress,
                                     get_tagged)
        return pack_objects_to_data(objects)
コード例 #10
0
ファイル: test_client.py プロジェクト: usmangani1/dulwich
 def generate_pack_data(have, want, ofs_delta=False):
     return pack_objects_to_data([
         (commit, None),
         (tree, b''),
     ])
コード例 #11
0
ファイル: test_client.py プロジェクト: atbradley/dulwich
 def generate_pack_data(have, want, ofs_delta=False):
     return pack_objects_to_data([(commit, None), (tree, b''), ])
コード例 #12
0
ファイル: rename-branch.py プロジェクト: pmrowla/dulwich
def generate_pack_data(*args, **kwargs):
    return pack_objects_to_data([])
コード例 #13
0
ファイル: remote.py プロジェクト: jelmer/breezy
 def generate_pack_data(have, want, ofs_delta=False):
     return pack_objects_to_data([])