Changeset 10 in tracdarcs


Ignore:
Timestamp:
02/11/06 12:24:08 (7 years ago)
Author:
lele@…
Hash name:
20060211112408-7a6fb-a16bbbb4f531868380d81f17c46d99a49db63422
Message:

Do the right job when the path is empty (on root)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tracdarcs/repos.py

    r9 r10  
    438438        if kind == Node.DIRECTORY: 
    439439            revdone = {} 
    440             cursor.execute("SELECT rev,kind,change,base_path" 
    441                            "  FROM node_change " 
    442                            "WHERE ((LENGTH(rev)<LENGTH(%s)) OR " 
    443                            "       (LENGTH(rev)=LENGTH(%s) AND rev<=%s)) " 
    444                            "  AND (path=%s OR path GLOB %s) " 
    445                            "ORDER BY -LENGTH(rev),rev DESC ", 
    446                            (rev, rev, rev, path, path+'/*')) 
     440            sql = "SELECT path,rev,kind,change,base_path FROM node_change " \ 
     441                  "WHERE ((LENGTH(rev)<LENGTH(%s)) OR " \ 
     442                  "       (LENGTH(rev)=LENGTH(%s) AND rev<=%s)) " 
     443            if path: 
     444                sql += "  AND (path=%s OR path GLOB %s) " 
     445            sql += "ORDER BY -LENGTH(rev),rev DESC " 
     446            if path: 
     447                cursor.execute(sql, (rev, rev, rev, path, path+'/*')) 
     448            else: 
     449                cursor.execute(sql, (rev, rev, rev)) 
    447450            for row in cursor: 
    448451                path, rev, kind, change, base_path = row 
Note: See TracChangeset for help on using the changeset viewer.