33 Class implementing the version control systems interface to Mercurial. |
33 Class implementing the version control systems interface to Mercurial. |
34 |
34 |
35 @signal committed() emitted after the commit action has completed |
35 @signal committed() emitted after the commit action has completed |
36 @signal activeExtensionsChanged() emitted when the list of active |
36 @signal activeExtensionsChanged() emitted when the list of active |
37 extensions has changed |
37 extensions has changed |
|
38 @signal iniFileChanged() emitted when a Mercurial/repo configuration file |
|
39 has changed |
38 """ |
40 """ |
39 committed = pyqtSignal() |
41 committed = pyqtSignal() |
40 activeExtensionsChanged = pyqtSignal() |
42 activeExtensionsChanged = pyqtSignal() |
|
43 iniFileChanged = pyqtSignal() |
41 |
44 |
42 IgnoreFileName = ".hgignore" |
45 IgnoreFileName = ".hgignore" |
43 |
46 |
44 def __init__(self, plugin, parent=None, name=None): |
47 def __init__(self, plugin, parent=None, name=None): |
45 """ |
48 """ |
2253 cfg.write("patterns =\n") |
2256 cfg.write("patterns =\n") |
2254 cfg.write(" {0}\n".format( |
2257 cfg.write(" {0}\n".format( |
2255 "\n ".join(lfPattern))) |
2258 "\n ".join(lfPattern))) |
2256 cfg.close() |
2259 cfg.close() |
2257 self.__monitorRepoIniFile(repodir) |
2260 self.__monitorRepoIniFile(repodir) |
|
2261 self.__iniFileChanged(cfgFile) |
2258 except IOError: |
2262 except IOError: |
2259 pass |
2263 pass |
2260 self.repoEditor = MiniEditor(cfgFile, "Properties") |
2264 self.repoEditor = MiniEditor(cfgFile, "Properties") |
2261 self.repoEditor.show() |
2265 self.repoEditor.show() |
2262 |
2266 |
3240 output = str(process.readAllStandardOutput(), |
3244 output = str(process.readAllStandardOutput(), |
3241 self.getEncoding(), 'replace') |
3245 self.getEncoding(), 'replace') |
3242 else: |
3246 else: |
3243 output, error = self.__client.runcommand(args) |
3247 output, error = self.__client.runcommand(args) |
3244 |
3248 |
|
3249 self.__defaultConfigured = False |
|
3250 self.__defaultPushConfigured = False |
3245 if output: |
3251 if output: |
3246 self.__defaultConfigured = False |
|
3247 self.__defaultPushConfigured = False |
|
3248 for line in output.splitlines(): |
3252 for line in output.splitlines(): |
3249 if line.startswith("paths.default=") and \ |
3253 if line.startswith("paths.default=") and \ |
3250 not line.strip().endswith("="): |
3254 not line.strip().endswith("="): |
3251 self.__defaultConfigured = True |
3255 self.__defaultConfigured = True |
3252 if line.startswith("paths.default-push=") and \ |
3256 if line.startswith("paths.default-push=") and \ |
3288 |
3292 |
3289 self.__getExtensionsInfo() |
3293 self.__getExtensionsInfo() |
3290 |
3294 |
3291 if self.__repoIniFile and path == self.__repoIniFile: |
3295 if self.__repoIniFile and path == self.__repoIniFile: |
3292 self.__checkDefaults() |
3296 self.__checkDefaults() |
|
3297 |
|
3298 self.iniFileChanged.emit() |
3293 |
3299 |
3294 def __monitorRepoIniFile(self, name): |
3300 def __monitorRepoIniFile(self, name): |
3295 """ |
3301 """ |
3296 Private slot to add a repository configuration file to the list of |
3302 Private slot to add a repository configuration file to the list of |
3297 monitored files. |
3303 monitored files. |