eric6/Plugins/VcsPlugins/vcsPySvn/subversion.py

changeset 8243
cc717c2ae956
parent 8234
fcb6b4b96274
child 8259
2bbec88047dd
equal deleted inserted replaced
8242:aa713ac50c0d 8243:cc717c2ae956
10 import re 10 import re
11 import os 11 import os
12 import shutil 12 import shutil
13 import time 13 import time
14 from urllib.parse import quote 14 from urllib.parse import quote
15 import contextlib
15 16
16 from PyQt5.QtCore import pyqtSignal, Qt, QDateTime, QCoreApplication 17 from PyQt5.QtCore import pyqtSignal, Qt, QDateTime, QCoreApplication
17 from PyQt5.QtWidgets import QLineEdit, QDialog, QInputDialog, QApplication 18 from PyQt5.QtWidgets import QLineEdit, QDialog, QInputDialog, QApplication
18 19
19 from E5Gui.E5Application import e5App 20 from E5Gui.E5Application import e5App
1477 client.callback_get_login = mixin._clientLoginCallback 1478 client.callback_get_login = mixin._clientLoginCallback
1478 client.callback_ssl_server_trust_prompt = ( 1479 client.callback_ssl_server_trust_prompt = (
1479 mixin._clientSslServerTrustPromptCallback 1480 mixin._clientSslServerTrustPromptCallback
1480 ) 1481 )
1481 1482
1482 try: 1483 with contextlib.suppress(pysvn.ClientError):
1483 with E5MutexLocker(self.vcsExecutionMutex): 1484 with E5MutexLocker(self.vcsExecutionMutex):
1484 allFiles = client.status(dname, recurse=True, get_all=True, 1485 allFiles = client.status(dname, recurse=True, get_all=True,
1485 ignore=True, update=False) 1486 ignore=True, update=False)
1486 dirs = [x for x in names.keys() if os.path.isdir(x)] 1487 dirs = [x for x in names.keys() if os.path.isdir(x)]
1487 for file in allFiles: 1488 for file in allFiles:
1510 self.statusCache[d] = self.canBeCommitted 1511 self.statusCache[d] = self.canBeCommitted
1511 dirs.remove(d) 1512 dirs.remove(d)
1512 break 1513 break
1513 else: 1514 else:
1514 self.statusCache[name] = self.canBeAdded 1515 self.statusCache[name] = self.canBeAdded
1515 except pysvn.ClientError:
1516 # ignore pysvn errors
1517 pass
1518 1516
1519 return names 1517 return names
1520 1518
1521 def __vcsAllRegisteredStates_wc(self, names, dname, shortcut=True): 1519 def __vcsAllRegisteredStates_wc(self, names, dname, shortcut=True):
1522 """ 1520 """
1557 client.callback_get_login = mixin._clientLoginCallback 1555 client.callback_get_login = mixin._clientLoginCallback
1558 client.callback_ssl_server_trust_prompt = ( 1556 client.callback_ssl_server_trust_prompt = (
1559 mixin._clientSslServerTrustPromptCallback 1557 mixin._clientSslServerTrustPromptCallback
1560 ) 1558 )
1561 1559
1562 try: 1560 with contextlib.suppress(pysvn.ClientError):
1563 with E5MutexLocker(self.vcsExecutionMutex): 1561 with E5MutexLocker(self.vcsExecutionMutex):
1564 allFiles = client.status(dname, recurse=True, get_all=True, 1562 allFiles = client.status(dname, recurse=True, get_all=True,
1565 ignore=True, update=False) 1563 ignore=True, update=False)
1566 for file in allFiles: 1564 for file in allFiles:
1567 name = os.path.normcase(file.path) 1565 name = os.path.normcase(file.path)
1569 if name in names: 1567 if name in names:
1570 names[name] = self.canBeCommitted 1568 names[name] = self.canBeCommitted
1571 self.statusCache[name] = self.canBeCommitted 1569 self.statusCache[name] = self.canBeCommitted
1572 else: 1570 else:
1573 self.statusCache[name] = self.canBeAdded 1571 self.statusCache[name] = self.canBeAdded
1574 except pysvn.ClientError:
1575 # ignore pysvn errors
1576 pass
1577 1572
1578 return names 1573 return names
1579 1574
1580 def __isVersioned(self, status): 1575 def __isVersioned(self, status):
1581 """ 1576 """
2453 """ 2448 """
2454 changelists = [] 2449 changelists = []
2455 client = self.getClient() 2450 client = self.getClient()
2456 if hasattr(client, 'get_changelist'): 2451 if hasattr(client, 'get_changelist'):
2457 ppath = e5App().getObject("Project").getProjectPath() 2452 ppath = e5App().getObject("Project").getProjectPath()
2458 try: 2453 with contextlib.suppress(pysvn.ClientError):
2459 with E5MutexLocker(self.vcsExecutionMutex): 2454 with E5MutexLocker(self.vcsExecutionMutex):
2460 entries = client.get_changelist( 2455 entries = client.get_changelist(
2461 ppath, depth=pysvn.depth.infinity) 2456 ppath, depth=pysvn.depth.infinity)
2462 for entry in entries: 2457 for entry in entries:
2463 changelist = entry[1] 2458 changelist = entry[1]
2464 if changelist not in changelists: 2459 if changelist not in changelists:
2465 changelists.append(changelist) 2460 changelists.append(changelist)
2466 except pysvn.ClientError:
2467 pass
2468 2461
2469 return changelists 2462 return changelists
2470 2463
2471 def svnUpgrade(self, path): 2464 def svnUpgrade(self, path):
2472 """ 2465 """

eric ide

mercurial