hgext/convert/subversion.py
changeset 5113 792c1d979097
parent 5112 18abf13064cb
child 5114 bcf6ba3fcbe4
equal deleted inserted replaced
5112:18abf13064cb 5113:792c1d979097
    75         t = transport.SvnRaTransport(url=url)
    75         t = transport.SvnRaTransport(url=url)
    76         svn.ra.get_log(t.ra, paths, start, end, limit,
    76         svn.ra.get_log(t.ra, paths, start, end, limit,
    77                        discover_changed_paths,
    77                        discover_changed_paths,
    78                        strict_node_history,
    78                        strict_node_history,
    79                        receiver)
    79                        receiver)
    80     except SubversionException, (_, num):
    80     except SubversionException, (inst, num):
    81         pickle.dump(num, fp, protocol)
    81         pickle.dump(num, fp, protocol)
    82     else:
    82     else:
    83         pickle.dump(None, fp, protocol)
    83         pickle.dump(None, fp, protocol)
    84     fp.close()
    84     fp.close()
    85 
    85 
   188                 brevnum = self.latest(module, self.last_changed)
   188                 brevnum = self.latest(module, self.last_changed)
   189                 brev = self.revid(brevnum, module)
   189                 brev = self.revid(brevnum, module)
   190                 self.ui.note('found branch %s at %d\n' % (branch, brevnum))
   190                 self.ui.note('found branch %s at %d\n' % (branch, brevnum))
   191                 self.heads.append(brev)
   191                 self.heads.append(brev)
   192         elif cfgtrunk or cfgbranches:
   192         elif cfgtrunk or cfgbranches:
   193             raise util.Abort(_('trunk/branch layout expected, '
   193             raise util.Abort('trunk/branch layout expected, but not found')
   194                                'but not found'))
       
   195         else:
   194         else:
   196             self.ui.note('working with one branch\n')
   195             self.ui.note('working with one branch\n')
   197             self.heads = [self.head]
   196             self.heads = [self.head]
   198         return self.heads
   197         return self.heads
   199 
   198 
   267                     ent = orig_paths[path]
   266                     ent = orig_paths[path]
   268                     source = ent.copyfrom_path
   267                     source = ent.copyfrom_path
   269                     rev = ent.copyfrom_rev
   268                     rev = ent.copyfrom_rev
   270                     tag = path.split('/', 2)[2]
   269                     tag = path.split('/', 2)[2]
   271                     tags[tag] = self.revid(rev, module=source)
   270                     tags[tag] = self.revid(rev, module=source)
   272         except SubversionException, (_, num):
   271         except SubversionException, (inst, num):
   273             self.ui.note('no tags found at revision %d\n' % start)
   272             self.ui.note('no tags found at revision %d\n' % start)
   274         return tags
   273         return tags
   275 
   274 
   276     # -- helper functions --
   275     # -- helper functions --
   277 
   276 
   605                     continue
   604                     continue
   606                 if orig_paths is None:
   605                 if orig_paths is None:
   607                     self.ui.debug('revision %d has no entries\n' % revnum)
   606                     self.ui.debug('revision %d has no entries\n' % revnum)
   608                     continue
   607                     continue
   609                 parselogentry(orig_paths, revnum, author, date, message)
   608                 parselogentry(orig_paths, revnum, author, date, message)
   610         except SubversionException, (_, num):
   609         except SubversionException, (inst, num):
   611             if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION:
   610             if num == svn.core.SVN_ERR_FS_NO_SUCH_REVISION:
   612                 raise NoSuchRevision(branch=self,
   611                 raise NoSuchRevision(branch=self,
   613                     revision="Revision number %d" % to_revnum)
   612                     revision="Revision number %d" % to_revnum)
   614             raise
   613             raise
   615 
   614