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

branch
eric7
changeset 9616
13aa04c979d7
parent 9473
3f23dbf37dbe
child 9653
e67609152c5e
equal deleted inserted replaced
9615:fbb3616f6bd3 9616:13aa04c979d7
5 5
6 """ 6 """
7 Module implementing a class to generate the output of the git diff command 7 Module implementing a class to generate the output of the git diff command
8 process. 8 process.
9 """ 9 """
10
11 import os
12 10
13 from PyQt6.QtCore import QObject, QProcess, QTimer, pyqtSignal 11 from PyQt6.QtCore import QObject, QProcess, QTimer, pyqtSignal
14 12
15 from eric7 import Preferences 13 from eric7 import Preferences
16 from eric7.EricGui.EricOverrideCursor import EricOverrideCursorProcess 14 from eric7.EricGui.EricOverrideCursor import EricOverrideCursorProcess
140 args.append("--patch") 138 args.append("--patch")
141 if stashName: 139 if stashName:
142 args.append(stashName) 140 args.append(stashName)
143 141
144 # find the root of the repo 142 # find the root of the repo
145 repodir = dname 143 repodir = self.vcs.findRepoRoot(dname)
146 while not os.path.isdir(os.path.join(repodir, self.vcs.adminDir)): 144 if not repodir:
147 repodir = os.path.dirname(repodir) 145 return False
148 if os.path.splitdrive(repodir)[1] == os.sep:
149 return False
150 146
151 self.__process.kill() 147 self.__process.kill()
152 self.__process.setWorkingDirectory(repodir) 148 self.__process.setWorkingDirectory(repodir)
153 self.__process.start("git", args) 149 self.__process.start("git", args)
154 procStarted = self.__process.waitForStarted(5000) 150 procStarted = self.__process.waitForStarted(5000)

eric ide

mercurial