これは完全に実行可能で、いくつかの小さなハックが必要なだけです...うわー!
私が抱えていた問題は、get_repository が trac.ini ファイルから svn リポジトリの値を読み取ることです。これは、Y:/ ではなく E:/ を指していました。簡単な修正では、リポジトリがrepository_dirにあるかどうかを確認し、そうでない場合は、新しい変数remote_repository_dirを確認します。修正の 2 番目の部分では、現在のリポジトリ アドレスが渡されたものと一致するかどうかを確認する cache.py からエラー メッセージを削除します。
いつものように、これは自己責任で使用し、事前にすべてをバックアップしてください!!!
最初に trac.ini ファイルを開き、新しい変数 'remote_repository_dir' を 'repository_dir' 変数の下に追加します。リモート リポジトリ dir は、ローカル マシン上のマップされたドライブを指します。次のようになります。
repository_dir = E:/Projects/svn/InfoProj
remote_repository_dir = Y:/Projects/svn/InfoProj
次に、api.py ファイルを変更して、 repository_dirの場所にリポジトリが見つからない場合に新しい変数を確認します。:71 頃には、次のようなものが必要です。
repository_dir = Option('trac', 'repository_dir', '',
"""Path to local repository. This can also be a relative path
(''since 0.11'').""")
この行の下に次を追加します。
remote_repository_dir = Option('trac', 'remote_repository_dir', '',
"""Path to remote repository.""")
次の :156 付近では、次のようになります。
rtype, rdir = self.repository_type, self.repository_dir
if not os.path.isabs(rdir):
rdir = os.path.join(self.env.path, rdir)
これを次のように変更します。
rtype, rdir = self.repository_type, self.repository_dir
if not os.path.isdir(rdir):
rdir = self.remote_repository_dir
if not os.path.isabs(rdir):
rdir = os.path.join(self.env.path, rdir)
最後に、cache.py ファイルのアラートを削除する必要があります (これは最善の方法ではないことに注意してください。チェックの一部としてリモート変数を含めることができるはずですが、今のところは機能します)。
:97 付近の cache.py では、次のようになります。
if repository_dir:
# directory part of the repo name can vary on case insensitive fs
if os.path.normcase(repository_dir) != os.path.normcase(self.name):
self.log.info("'repository_dir' has changed from %r to %r"
% (repository_dir, self.name))
raise TracError(_("The 'repository_dir' has changed, a "
"'trac-admin resync' operation is needed."))
elif repository_dir is None: #
self.log.info('Storing initial "repository_dir": %s' % self.name)
cursor.execute("INSERT INTO system (name,value) VALUES (%s,%s)",
(CACHE_REPOSITORY_DIR, self.name,))
else: # 'repository_dir' cleared by a resync
self.log.info('Resetting "repository_dir": %s' % self.name)
cursor.execute("UPDATE system SET value=%s WHERE name=%s",
(self.name, CACHE_REPOSITORY_DIR))
if ステートメントの最初の部分を削除するので、次のようになります。
if repository_dir is None: #
self.log.info('Storing initial "repository_dir": %s' % self.name)
cursor.execute("INSERT INTO system (name,value) VALUES (%s,%s)",
(CACHE_REPOSITORY_DIR, self.name,))
else: # 'repository_dir' cleared by a resync
self.log.info('Resetting "repository_dir": %s' % self.name)
cursor.execute("UPDATE system SET value=%s WHERE name=%s",
(self.name, CACHE_REPOSITORY_DIR))
警告!これを行うと、ディレクトリが変更され、再同期が必要な場合にエラーが発生しなくなります。
これが誰かに役立つことを願っています。