src/eric7/Plugins/VcsPlugins/vcsGit/GitReflogBrowserDialog.py

branch
eric7
changeset 9616
13aa04c979d7
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
equal deleted inserted replaced
9615:fbb3616f6bd3 9616:13aa04c979d7
142 @param selector selector info (string) 142 @param selector selector info (string)
143 @param name name info (string) 143 @param name name info (string)
144 @param subject subject of the reflog entry (string) 144 @param subject subject of the reflog entry (string)
145 @return reference to the generated item (QTreeWidgetItem) 145 @return reference to the generated item (QTreeWidgetItem)
146 """ 146 """
147 operation, subject = subject.strip().split(": ", 1) 147 try:
148 columnLabels = [ 148 operation, subject = subject.strip().split(": ", 1)
149 commitId, 149 except ValueError:
150 selector, 150 operation = ""
151 name, 151
152 operation, 152 return QTreeWidgetItem(
153 subject, 153 self.logTree,
154 ] 154 [
155 itm = QTreeWidgetItem(self.logTree, columnLabels) 155 commitId,
156 return itm 156 selector,
157 name,
158 operation,
159 subject,
160 ],
161 )
157 162
158 def __getReflogEntries(self, skip=0): 163 def __getReflogEntries(self, skip=0):
159 """ 164 """
160 Private method to retrieve reflog entries from the repository. 165 Private method to retrieve reflog entries from the repository.
161 166
212 QApplication.processEvents() 217 QApplication.processEvents()
213 218
214 self.__initData() 219 self.__initData()
215 220
216 # find the root of the repo 221 # find the root of the repo
217 self.repodir = projectdir 222 self.repodir = self.vcs.findRepoRoot(projectdir)
218 while not os.path.isdir(os.path.join(self.repodir, self.vcs.adminDir)): 223 if not self.repodir:
219 self.repodir = os.path.dirname(self.repodir) 224 return
220 if os.path.splitdrive(self.repodir)[1] == os.sep:
221 return
222 225
223 self.activateWindow() 226 self.activateWindow()
224 self.raise_() 227 self.raise_()
225 228
226 self.logTree.clear() 229 self.logTree.clear()

eric ide

mercurial