diff -u trac/Browser.py trac2/Browser.py
--- trac/Browser.py	2004-05-20 11:26:32.000000000 -0700
+++ trac2/Browser.py	2004-08-11 13:44:38.265625000 -0700
@@ -40,7 +40,9 @@
         except core.SubversionException:
             raise TracError('Invalid revision number: %d' % revision)
 
+        path = svn_path_join( self.repos_path, path)
         node_type = fs.check_path(root, path, self.pool)
+        
         if not node_type in [core.svn_node_dir, core.svn_node_file]:
             raise TracError('"%s": no such file or directory in revision %d' \
                             % (path, revision), 'Not such file or directory')
@@ -78,10 +80,16 @@
             else:
                 date_seconds = 0
                 date = ''
+       
+            if self.repos_path:
+                url_path = fullpath[len(self.repos_path):]
+            else:
+                url_path = fullpath
 
             item = {
                 'name'       : name,
                 'fullpath'   : fullpath,
+                'urlpath'    : url_path,
                 'created_rev': created_rev,
                 'date'       : date,
                 'date_seconds' : date_seconds,
@@ -90,18 +98,18 @@
                 'size'       : pretty_size(size),
                 'size_bytes' : size }
             if rev_specified:
-                item['log_href'] = self.env.href.log(fullpath, revision)
+                item['log_href'] = self.env.href.log(url_path, revision)
                 if is_dir:
-                    item['browser_href'] = self.env.href.browser(fullpath,
+                    item['browser_href'] = self.env.href.browser(url_path,
                                                                  revision)
                 else:
-                    item['browser_href'] = self.env.href.file(fullpath, revision)
+                    item['browser_href'] = self.env.href.file(url_path, revision)
             else:
-                item['log_href'] = self.env.href.log(fullpath)
+                item['log_href'] = self.env.href.log(url_path)
                 if is_dir:
-                    item['browser_href'] = self.env.href.browser(fullpath)
+                    item['browser_href'] = self.env.href.browser(url_path)
                 else:
-                    item['browser_href'] = self.env.href.file(fullpath)
+                    item['browser_href'] = self.env.href.file(url_path)
 
             info.append(item)
         return info
diff -u trac/File.py trac2/File.py
--- trac/File.py	2004-05-24 13:04:02.000000000 -0700
+++ trac2/File.py	2004-08-11 13:44:38.312500000 -0700
@@ -222,7 +222,9 @@
         FileCommon.render(self)
         
         rev = self.args.get('rev', None)
-        self.path = self.args.get('path', '/')
+        path = self.args.get('path', '/')
+        self.path = util.svn_path_join(self.repos_path, path)
+        
         if not rev:
             rev_specified = 0
             rev = svn.fs.youngest_rev(self.fs_ptr, self.pool)
diff -u trac/core.py trac2/core.py
--- trac/core.py	2004-06-03 12:32:44.000000000 -0700
+++ trac2/core.py	2004-08-11 13:44:38.359375000 -0700
@@ -151,10 +151,12 @@
     if need_svn:
         import sync
         repos_dir = env.get_config('trac', 'repository_dir')
+        repos_path = env.get_config('trac', 'repository_path')
         pool, rep, fs_ptr = open_svn_repos(repos_dir)
         module.repos = rep
+        module.repos_path = repos_path        
         module.fs_ptr = fs_ptr
-        sync.sync(module.db, rep, fs_ptr, pool)
+        sync.sync(module.db, rep, repos_path, fs_ptr, pool)
         module.pool = pool
     return module
 
Common subdirectories: trac/mimeviewers and trac2/mimeviewers
diff -u trac/sync.py trac2/sync.py
--- trac/sync.py	2004-05-19 12:04:12.000000000 -0700
+++ trac2/sync.py	2004-08-11 13:44:38.421875000 -0700
@@ -20,9 +20,9 @@
 # Author: Jonas Borgström <jonas@edgewall.com>
 
 from util import *
-from svn import fs, util, delta, repos, core
+from svn import fs, util, delta, core, repos
 
-def sync(db, repos, fs_ptr, pool):
+def sync(db, repo, repos_path, fs_ptr, pool):
     """
     updates the revision and node_change tables to be in sync with
     the repository.
@@ -36,12 +36,28 @@
     cursor = db.cursor()
     cursor.execute('SELECT ifnull(max(rev), 0) FROM revision')
     youngest_stored =  int(cursor.fetchone()[0])
+    
     max_rev = fs.youngest_rev(fs_ptr, pool)
-    num = max_rev - youngest_stored
+#    num = max_rev - youngest_stored
     offset = youngest_stored + 1
+    revision_set = []
     
+    if repos_path:
+        revision_set = get_revision_set(
+            db,
+            repo,
+            repos_path,
+            fs_ptr,
+            pool,
+            youngest_stored,
+            max_rev
+            )
+       
+    if not revision_set and not repos_path:
+        revision_set = range(youngest_stored+1, max_rev)
+
     subpool = core.svn_pool_create(pool)
-    for rev in range(num):
+    for rev in revision_set:
         message = fs.revision_prop(fs_ptr, rev + offset,
                                    util.SVN_PROP_REVISION_LOG, subpool)
         author = fs.revision_prop(fs_ptr, rev + offset,
@@ -54,36 +70,45 @@
         cursor.execute ('INSERT INTO revision (rev, time, author, message) '
                         'VALUES (%s, %s, %s, %s)', rev + offset, date,
                         author, message)
-        insert_change (subpool, fs_ptr, rev + offset, cursor)
+        insert_change (subpool, repos_path, fs_ptr, rev, cursor)
         core.svn_pool_clear(subpool)
 
     core.svn_pool_destroy(subpool)
     db.commit()
 
-def insert_change (pool, fs_ptr, rev, cursor):
+def insert_change (pool, repos_path, fs_ptr, rev, cursor):
     
     class ChangeEditor(delta.Editor):
-        def __init__(self, rev, old_root, new_root, cursor):
+        def __init__(self, rev, old_root, new_root, repos_path, cursor):
             self.rev = rev
             self.cursor = cursor
             self.old_root = old_root
             self.new_root = new_root
+            self.repos_path = repos_path
         
         def delete_entry(self, path, revision, parent_baton, pool):
+            if not path.startswith( self.repos_path):
+                return
             self.cursor.execute('INSERT INTO node_change (rev, name, change) '
                                 'VALUES (%s, %s, \'D\')', self.rev, path)
         
         def add_directory(self, path, parent_baton,
                           copyfrom_path, copyfrom_revision, dir_pool):
+            if not path.startswith( self.repos_path):
+                return
             self.cursor.execute('INSERT INTO node_change (rev, name, change) '
                                 'VALUES (%s, %s, \'A\')', self.rev, path)
 
         def add_file(self, path, parent_baton,
                      copyfrom_path, copyfrom_revision, file_pool):
+            if not path.startswith( self.repos_path):
+                return
             self.cursor.execute('INSERT INTO node_change (rev, name, change) '
                                 'VALUES (%s, %s, \'A\')',self.rev, path)
             
         def open_file(self, path, parent_baton, base_revision, file_pool):
+            if not path.startswith( self.repos_path):
+                return            
             self.cursor.execute('INSERT INTO node_change (rev, name, change) '
                                 'VALUES (%s, %s, \'M\')',self.rev, path)
 
@@ -91,7 +116,7 @@
     old_root = fs.revision_root(fs_ptr, rev - 1, pool)
     new_root = fs.revision_root(fs_ptr, rev, pool)
     
-    editor = ChangeEditor(rev, old_root, new_root, cursor)
+    editor = ChangeEditor(rev, old_root, new_root, repos_path, cursor)
     e_ptr, e_baton = delta.make_editor(editor, pool)
 
     if util.SVN_VER_MAJOR == 0 and util.SVN_VER_MINOR == 37:
@@ -104,3 +129,33 @@
                                   new_root, '', e_ptr, e_baton, authz_cb,
                                   0, 1, 0, 1, pool)
 
+def get_revision_set( db, repo, repos_path, fs_ptr, pool, youngest_stored, max_rev):
+    revision_set = []
+    root = fs.revision_root(fs_ptr, max_rev, pool)
+    node_type = fs.check_path(root, repos_path, pool)
+
+    if not node_type in (core.svn_node_dir, core.svn_node_file):
+        raise ValueError("Svn Repository Path Invalid %r"%repos_path)
+    
+    revs = []
+    
+    def addLog( paths, revision, author, date, message, pool):
+        revs.append(revision)
+
+    repos.svn_repos_get_logs(
+            repo,
+            [repos_path],
+            max_rev, # start rev
+            0, # end rev
+            0, # changed paths
+            0, # strict history
+            addLog,
+            pool
+            )
+
+    revs.sort()
+    for rev in revs:
+        if rev > youngest_stored:
+            revision_set.append( rev )
+
+    return revision_set
Common subdirectories: trac/tests and trac2/tests
Common subdirectories: trac/upgrades and trac2/upgrades
diff -u trac/util.py trac2/util.py
--- trac/util.py	2004-05-20 11:26:31.000000000 -0700
+++ trac2/util.py	2004-08-11 13:44:38.453125000 -0700
@@ -29,6 +29,9 @@
 TRUE =  ['yes', '1', 1, 'true',  'on',  'aye']
 FALSE = ['no',  '0', 0, 'false', 'off', 'nay']
 
+def svn_path_join(*args):
+    return "/%s"%'/'.join(filter(None, '/'.join(args).split('/')))
+
 def svn_date_to_string(date, pool):
     from svn import util
     date_seconds = util.svn_time_from_cstring(date,
Common subdirectories: trac/wikimacros and trac2/wikimacros

