Revision 371d907a pithos/backends/lib/sqlite/node.py

b/pithos/backends/lib/sqlite/node.py
714 714
    
715 715
    def latest_version_list(self, parent, prefix='', delimiter=None,
716 716
                            start='', limit=10000, before=inf,
717
                            except_cluster=0, pathq=[], domain=None, filterq=[], sizeq=None):
717
                            except_cluster=0, pathq=[], domain=None,
718
                            filterq=[], sizeq=None, all_props=False):
718 719
        """Return a (list of (path, serial) tuples, list of common prefixes)
719 720
           for the current versions of the paths with the given parent,
720 721
           matching the following criteria.
......
761 762
           will always match.
762 763
           
763 764
           Limit applies to the first list of tuples returned.
765
           
766
           If all_props is True, return all properties after path, not just serial.
764 767
        """
765 768
        
766 769
        execute = self.execute
......
769 772
            start = strprevling(prefix)
770 773
        nextling = strnextling(prefix)
771 774
        
772
        q = ("select distinct n.path, v.serial "
775
        q = ("select distinct n.path, %s "
773 776
             "from versions v, nodes n "
774 777
             "where v.serial = (select max(serial) "
775 778
                               "from versions "
......
780 783
                            "where parent = ?) "
781 784
             "and n.node = v.node "
782 785
             "and n.path > ? and n.path < ?")
786
        if not all_props:
787
            q = q % "v.serial"
788
        else:
789
            q = q % "v.serial, v.node, v.hash, v.size, v.type, v.source, v.mtime, v.muser, v.uuid, v.checksum, v.cluster"
783 790
        args = [before, except_cluster, parent, start, nextling]
784 791
        
785 792
        subq, subargs = self._construct_paths(pathq)
......
819 826
            props = fetchone()
820 827
            if props is None:
821 828
                break
822
            path, serial = props
829
            path = props[0]
830
            serial = props[1]
823 831
            idx = path.find(delimiter, pfz)
824 832
            
825 833
            if idx < 0:

Also available in: Unified diff