def start(self, path, tags = True): """ Public slot to start the svn status command. @param path name of directory to be listed (string) @param tags flag indicating a list of tags is requested (False = branches, True = tags) """ self.errorGroup.hide() if not tags: self.setWindowTitle(self.trUtf8("Subversion Branches List")) self.activateWindow() QApplication.processEvents() dname, fname = self.vcs.splitPath(path) reposURL = self.vcs.svnGetReposName(dname) if reposURL is None: KQMessageBox.critical(None, self.trUtf8("Subversion Error"), self.trUtf8("""The URL of the project repository could not be""" """ retrieved from the working copy. The list operation will""" """ be aborted""")) self.close() return False if self.vcs.otherData["standardLayout"]: # determine the base path of the project in the repository rx_base = QRegExp('(.+)/(trunk|tags|branches).*') if not rx_base.exactMatch(reposURL): KQMessageBox.critical(None, self.trUtf8("Subversion Error"), self.trUtf8("""The URL of the project repository has an""" """ invalid format. The list operation will""" """ be aborted""")) return False reposRoot = unicode(rx_base.cap(1)) if tags: path = "%s/tags" % reposRoot else: path = "%s/branches" % reposRoot else: reposPath, ok = KQInputDialog.getText(\ self, self.trUtf8("Subversion List"), self.trUtf8("Enter the repository URL containing the tags or branches"), QLineEdit.Normal, self.vcs.svnNormalizeURL(reposURL)) if not ok: self.close() return False if reposPath.isEmpty(): KQMessageBox.critical(None, self.trUtf8("Subversion List"), self.trUtf8("""The repository URL is empty. Aborting...""")) self.close() return False path = unicode(reposPath) locker = QMutexLocker(self.vcs.vcsExecutionMutex) self.tagsList = QStringList() cwd = os.getcwd() os.chdir(dname) try: entries = self.client.list(path, recurse = False) for dirent, lock in entries: if dirent["path"] != path: name = dirent["path"].replace(path + '/', "") self.__generateItem(dirent["created_rev"].number, dirent["last_author"], formatTime(dirent["time"]), name) if self.vcs.otherData["standardLayout"]: self.tagsList.append(name) else: self.tagsList.append(path + '/' + name) if self._clientCancelCallback(): break res = True except pysvn.ClientError, e: self.__showError(e.args[0]) res = False
def start(self, projectPath, fn): """ Public slot to start the svn info command. @param projectPath path name of the project (string) @param fn file or directory name relative to the project (string) """ locker = QMutexLocker(self.vcs.vcsExecutionMutex) cwd = os.getcwd() os.chdir(projectPath) try: entries = self.client.info2(fn, recurse = False) infoStr = QString("<table>") for path, info in entries: infoStr.append(self.trUtf8(\ "<tr><td><b>Path (relative to project):</b></td><td>%1</td></tr>")\ .arg(path)) if info['URL']: infoStr.append(self.trUtf8(\ "<tr><td><b>Url:</b></td><td>%1</td></tr>")\ .arg(info['URL'])) if info['rev']: infoStr.append(self.trUtf8(\ "<tr><td><b>Revision:</b></td><td>%1</td></tr>")\ .arg(info['rev'].number)) if info['repos_root_URL']: infoStr.append(self.trUtf8(\ "<tr><td><b>Repository root URL:</b></td><td>%1</td></tr>")\ .arg(info['repos_root_URL'])) if info['repos_UUID']: infoStr.append(self.trUtf8(\ "<tr><td><b>Repository UUID:</b></td><td>%1</td></tr>")\ .arg(info['repos_UUID'])) if info['last_changed_author']: infoStr.append(self.trUtf8(\ "<tr><td><b>Last changed author:</b></td><td>%1</td></tr>")\ .arg(info['last_changed_author'])) if info['last_changed_date']: infoStr.append(self.trUtf8(\ "<tr><td><b>Last Changed Date:</b></td><td>%1</td></tr>")\ .arg(formatTime(info['last_changed_date']))) if info['last_changed_rev'] and \ info['last_changed_rev'].kind == pysvn.opt_revision_kind.number: infoStr.append(self.trUtf8(\ "<tr><td><b>Last changed revision:</b></td><td>%1</td></tr>")\ .arg(info['last_changed_rev'].number)) if info['kind']: if info['kind'] == pysvn.node_kind.file: nodeKind = self.trUtf8("file") elif info['kind'] == pysvn.node_kind.dir: nodeKind = self.trUtf8("directory") elif info['kind'] == pysvn.node_kind.none: nodeKind = self.trUtf8("none") else: nodeKind = self.trUtf8("unknown") infoStr.append(self.trUtf8(\ "<tr><td><b>Node kind:</b></td><td>%1</td></tr>")\ .arg(nodeKind)) if info['lock']: lockInfo = info['lock'] infoStr.append(self.trUtf8(\ "<tr><td><b>Lock Owner:</b></td><td>%1</td></tr>")\ .arg(lockInfo['owner'])) infoStr.append(self.trUtf8(\ "<tr><td><b>Lock Creation Date:</b></td><td>%1</td></tr>")\ .arg(formatTime(lockInfo['creation_date']))) if lockInfo['expiration_date'] is not None: infoStr.append(\ self.trUtf8(\ "<tr><td><b>Lock Expiration Date:</b></td><td>%1</td></tr>")\ .arg(formatTime(lockInfo['expiration_date']))) infoStr.append(self.trUtf8(\ "<tr><td><b>Lock Token:</b></td><td>%1</td></tr>")\ .arg(lockInfo['token'])) infoStr.append(self.trUtf8(\ "<tr><td><b>Lock Comment:</b></td><td>%1</td></tr>")\ .arg(lockInfo['comment'])) if info['wc_info']: wcInfo = info['wc_info'] if wcInfo['schedule']: if wcInfo['schedule'] == pysvn.wc_schedule.normal: schedule = self.trUtf8("normal") elif wcInfo['schedule'] == pysvn.wc_schedule.add: schedule = self.trUtf8("add") elif wcInfo['schedule'] == pysvn.wc_schedule.delete: schedule = self.trUtf8("delete") elif wcInfo['schedule'] == pysvn.wc_schedule.replace: schedule = self.trUtf8("replace") infoStr.append(self.trUtf8(\ "<tr><td><b>Schedule:</b></td><td>%1</td></tr>")\ .arg(schedule)) if wcInfo['copyfrom_url']: infoStr.append(self.trUtf8(\ "<tr><td><b>Copied From URL:</b></td><td>%1</td></tr>")\ .arg(wcInfo['copyfrom_url'])) infoStr.append(self.trUtf8(\ "<tr><td><b>Copied From Rev:</b></td><td>%1</td></tr>")\ .arg(wcInfo['copyfrom_rev'].number)) if wcInfo['text_time']: infoStr.append(self.trUtf8(\ "<tr><td><b>Text Last Updated:</b></td><td>%1</td></tr>")\ .arg(formatTime(wcInfo['text_time']))) if wcInfo['prop_time']: infoStr.append(self.trUtf8(\ "<tr><td><b>Properties Last Updated:</b></td><td>%1</td></tr>")\ .arg(formatTime(wcInfo['prop_time']))) if wcInfo['checksum']: infoStr.append(self.trUtf8(\ "<tr><td><b>Checksum:</b></td><td>%1</td></tr>")\ .arg(wcInfo['checksum'])) infoStr.append("</table>") self.infoBrowser.setHtml(infoStr) except pysvn.ClientError, e: self.__showError(e.args[0])