Example #1
0
  def _get_last_history_rev(self, path_parts, rev):
    """Return the a 2-tuple which contains:
         - the last interesting revision equal to or older than REV in
           the history of PATH_PARTS.
         - the created_rev of of PATH_PARTS as of REV."""
    
    path = self._getpath(path_parts)
    url = self._geturl(self._getpath(path_parts))
    optrev = _rev2optrev(rev)

    # Get the last-changed-rev.
    revisions = []
    def _info_cb(path, info, pool, retval=revisions):
      revisions.append(info.last_changed_rev)
    client.svn_client_info(url, optrev, optrev, _info_cb, 0, self.ctx)
    last_changed_rev = revisions[0]

    # Now, this object might not have been directly edited since the
    # last-changed-rev, but it might have been the child of a copy.
    # To determine this, we'll run a potentially no-op log between
    # LAST_CHANGED_REV and REV.
    lc = LogCollector(path, 1, None, None)
    client_log(url, optrev, _rev2optrev(last_changed_rev), 1, 1, 0,
               lc.add_log, self.ctx)
    revs = lc.logs
    if revs:
      revs.sort()
      return revs[0].number, last_changed_rev
    else:
      return last_changed_rev, last_changed_rev
Example #2
0
    def _get_last_history_rev(self, path_parts, rev):
        """Return the a 2-tuple which contains:
         - the last interesting revision equal to or older than REV in
           the history of PATH_PARTS.
         - the created_rev of of PATH_PARTS as of REV."""

        path = self._getpath(path_parts)
        url = self._geturl(self._getpath(path_parts))
        optrev = _rev2optrev(rev)

        # Get the last-changed-rev.
        revisions = []

        def _info_cb(path, info, pool, retval=revisions):
            revisions.append(info.last_changed_rev)

        client.svn_client_info(url, optrev, optrev, _info_cb, 0, self.ctx)
        last_changed_rev = revisions[0]

        # Now, this object might not have been directly edited since the
        # last-changed-rev, but it might have been the child of a copy.
        # To determine this, we'll run a potentially no-op log between
        # LAST_CHANGED_REV and REV.
        lc = LogCollector(path, 1, None, None)
        client_log(url, optrev, _rev2optrev(last_changed_rev), 1, 1, 0,
                   lc.add_log, self.ctx)
        revs = lc.logs
        if revs:
            revs.sort()
            return revs[0].number, last_changed_rev
        else:
            return last_changed_rev, last_changed_rev
 def _get_last_history_rev(self, path_parts, rev):
   url = self._geturl(self._getpath(path_parts))
   optrev = _rev2optrev(rev)
   revisions = []
   def _info_cb(path, info, pool, retval=revisions):
     revisions.append(info.last_changed_rev)
   client.svn_client_info(url, optrev, optrev, _info_cb, 0, self.ctx)
   return revisions[0]
Example #4
0
    def _get_last_history_rev(self, path_parts, rev):
        url = self._geturl(self._getpath(path_parts))
        optrev = _rev2optrev(rev)
        revisions = []

        def _info_cb(path, info, pool, retval=revisions):
            revisions.append(info.last_changed_rev)

        client.svn_client_info(url, optrev, optrev, _info_cb, 0, self.ctx)
        return revisions[0]
    def get_path_revision(self, path):
        """Return the current base revision of versioned file or
        directory PATH."""

        infos = []
        def _info_cb(infopath, info, pool, retval=infos):
          infos.append(info)
        client.svn_client_info(path, self.base_optrev, self.base_optrev,
                               _info_cb, 0, self.ctx)
        assert len(infos) == 1
        return infos[0].rev
    def get_path_revision(self, path):
        """Return the current base revision of versioned file or
        directory PATH."""

        infos = []
        def _info_cb(infopath, info, pool, retval=infos):
          infos.append(info)
        client.svn_client_info(path, self.base_optrev, self.base_optrev,
                               _info_cb, 0, self.ctx)
        assert len(infos) == 1
        return infos[0].rev
    def get_path_urls(self, path):
        """Return a 2-tuple containing the repository URL associated
        with the versioned working file or directory located at
        PATH and the repository URL for the same."""

        infos = []
        def _info_cb(infopath, info, pool, retval=infos):
          infos.append(info)
        client.svn_client_info(path, self.base_optrev, self.base_optrev,
                               _info_cb, 0, self.ctx)
        assert len(infos) == 1
        return infos[0].URL, infos[0].repos_root_URL
    def get_path_urls(self, path):
        """Return a 2-tuple containing the repository URL associated
        with the versioned working file or directory located at
        PATH and the repository URL for the same."""

        infos = []
        def _info_cb(infopath, info, pool, retval=infos):
          infos.append(info)
        client.svn_client_info(path, self.base_optrev, self.base_optrev,
                               _info_cb, 0, self.ctx)
        assert len(infos) == 1
        return infos[0].URL, infos[0].repos_root_URL