Skip to content
Browse files

make SVN diff information more portable across multiple OSs

  • Loading branch information...
1 parent 77cdc14 commit 90fbe20fa2944c305b46d6ea385bb14e168b3a32 @alex committed Jul 11, 2009
Showing with 2 additions and 10 deletions.
  1. +2 −10 pyvcs/backends/
12 pyvcs/backends/
@@ -1,4 +1,5 @@
from datetime import datetime, timedelta
+from tempfile import NamedTemporaryFile
from time import mktime
import os
@@ -9,14 +10,6 @@
from pyvcs.repository import BaseRepository
from pyvcs.utils import generate_unified_diff
-# TODO: Fix path handling, with svn you have 2 paths, the local
-# one (working local copy) and the remote (svn server).
-# Local: /home/user/myrepo
-# Remote:
-# The problem is that remote path will be /myrepo/trunk,
-# this brings problems when quering svn for file information,
-# lists and logs. Assuming you are using a local working copy
-# everything should more or less work fine.
class Repository(BaseRepository):
def __init__(self, *args, **kwargs):
super(Repository, self).__init__(*args, **kwargs)
@@ -29,10 +22,9 @@ def _log_to_commit(self, log):
at = url[len(base):]
commit_files = [cp_dict['path'][len(at)+1:] for cp_dict in log['changed_paths']]
- # TODO: Generate portable tmp paths for Client API to do its diffs
# TODO: this fails if the commit preceeding this one isn't one the same
# branch
- diff = self._repo.diff('/tmp/pysvndiff-', url_or_path=self.path,
+ diff = self._repo.diff(NamedTemporaryFile().name, url_or_path=self.path,
revision1=pysvn.Revision(pysvn.opt_revision_kind.number, log['revision'].number-1),

0 comments on commit 90fbe20

Please sign in to comment.
Something went wrong with that request. Please try again.