hgext/convert/subversion.py
changeset 17424 e7cfe3587ea4
parent 17247 6d51a0c71d4e
child 17537 31f32a96e1e3
equal deleted inserted replaced
17406:fc14953e8e34 17424:e7cfe3587ea4
   885                 self.module = new_module
   885                 self.module = new_module
   886                 self.reparent(self.module)
   886                 self.reparent(self.module)
   887             io = StringIO()
   887             io = StringIO()
   888             info = svn.ra.get_file(self.ra, file, revnum, io)
   888             info = svn.ra.get_file(self.ra, file, revnum, io)
   889             data = io.getvalue()
   889             data = io.getvalue()
   890             # ra.get_files() seems to keep a reference on the input buffer
   890             # ra.get_file() seems to keep a reference on the input buffer
   891             # preventing collection. Release it explicitely.
   891             # preventing collection. Release it explicitly.
   892             io.close()
   892             io.close()
   893             if isinstance(info, list):
   893             if isinstance(info, list):
   894                 info = info[-1]
   894                 info = info[-1]
   895             mode = ("svn:executable" in info) and 'x' or ''
   895             mode = ("svn:executable" in info) and 'x' or ''
   896             mode = ("svn:special" in info) and 'l' or mode
   896             mode = ("svn:special" in info) and 'l' or mode
   921         if module is None:
   921         if module is None:
   922             module = self.module
   922             module = self.module
   923         # Given the repository url of this wc, say
   923         # Given the repository url of this wc, say
   924         #   "http://server/plone/CMFPlone/branches/Plone-2_0-branch"
   924         #   "http://server/plone/CMFPlone/branches/Plone-2_0-branch"
   925         # extract the "entry" portion (a relative path) from what
   925         # extract the "entry" portion (a relative path) from what
   926         # svn log --xml says, ie
   926         # svn log --xml says, i.e.
   927         #   "/CMFPlone/branches/Plone-2_0-branch/tests/PloneTestCase.py"
   927         #   "/CMFPlone/branches/Plone-2_0-branch/tests/PloneTestCase.py"
   928         # that is to say "tests/PloneTestCase.py"
   928         # that is to say "tests/PloneTestCase.py"
   929         if path.startswith(module):
   929         if path.startswith(module):
   930             relative = path.rstrip('/')[len(module):]
   930             relative = path.rstrip('/')[len(module):]
   931             if relative.startswith('/'):
   931             if relative.startswith('/'):