[PATCH 1/N] Document that CVSFile.get_filename() is normalised

Jon Foster <[email protected]> Wed, 31 Mar 2010 12:43:09 +0100
Newsgroups gmane.comp.version-control.subversion.cvs2svn.devel
Message-ID <[email protected]>
Hi,

The paths returned by CVSFile.get_filename() are already normalised,
there's no need to pass them through os.path.normpath() again.
I'm not happy relying on undocumented behaviour, so document this.

Kind regards,

Jon


**********************************************************************
This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions expressed are solely those of the author and do not necessarily represent those of Cabot Communications Ltd.

If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone.

Cabot Communications Limited
Verona House, Filwood Road, Bristol BS16 3RY, UK
+44 (0) 1179584232

Co. Registered in England number 02817269

Please contact the sender if you believe you have received this email in error.

**********************************************************************


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

------------------------------------------------------
http://cvs2svn.tigris.org/ds/viewMessage.do?dsForumId=1667&dsMessageId=2467667

To unsubscribe from this discussion, e-mail: [[email protected]].
cvs2svn_opt1_patch.txt (text/plain, 1.8 KB)
Index: cvs2svn_lib/project.py
===================================================================
--- cvs2svn_lib/project.py	(revision 5093)
+++ cvs2svn_lib/project.py	(working copy)
@@ -70,6 +70,8 @@
 
     self.id = id
 
+    # Note: CVSDirectory.get_filename() assumes that project_cvs_repos_path
+    #       is normalised by os.path.normpath().
     self.project_cvs_repos_path = os.path.normpath(project_cvs_repos_path)
     if not os.path.isdir(self.project_cvs_repos_path):
       raise FatalError("The specified CVS repository path '%s' is not an "
Index: cvs2svn_lib/cvs_path.py
===================================================================
--- cvs2svn_lib/cvs_path.py	(revision 5093)
+++ cvs2svn_lib/cvs_path.py	(working copy)
@@ -180,8 +180,14 @@
     self.empty_subdirectory_ids = []
 
   def get_filename(self):
-    """Return the filesystem path to this CVSPath in the CVS repository."""
+    """Return the filesystem path to this CVSPath in the CVS repository.
 
+    This is in native format, and already normalised the way
+    os.path.normpath() normalises paths.
+
+    It starts with the repository path passed to run_options.add_project()
+    in the options.py file."""
+
     if self.parent_directory is None:
       return self.project.project_cvs_repos_path
     else:
@@ -272,8 +278,14 @@
     assert self.parent_directory is not None
 
   def get_filename(self):
-    """Return the filesystem path to this CVSPath in the CVS repository."""
+    """Return the filesystem path to this CVSPath in the CVS repository.
 
+    This is in native format, and already normalised the way
+    os.path.normpath() normalises paths.
+
+    It starts with the repository path passed to run_options.add_project()
+    in the options.py file."""
+
     if self._in_attic:
       return os.path.join(
           self.parent_directory.filename, 'Attic', self.basename + ',v'