Plugins/VcsPlugins/vcsPySvn/subversion.py

branch
Py2 comp.
changeset 3142
55030c09e142
parent 3141
72f3bde98c58
parent 3128
2d4ccc459f7e
child 3145
a9de05d4a22f
equal deleted inserted replaced
3141:72f3bde98c58 3142:55030c09e142
1495 locker.unlock() 1495 locker.unlock()
1496 dirs = [x for x in names.keys() if os.path.isdir(x)] 1496 dirs = [x for x in names.keys() if os.path.isdir(x)]
1497 for file in allFiles: 1497 for file in allFiles:
1498 # file.path is always unicode in Python 2 1498 # file.path is always unicode in Python 2
1499 name = os.path.normcase(file.path) 1499 name = os.path.normcase(file.path)
1500 if file.is_versioned: 1500 if self.__isVersioned(file):
1501 if name in names: 1501 if name in names:
1502 names[name] = self.canBeCommitted 1502 names[name] = self.canBeCommitted
1503 dn = name 1503 dn = name
1504 while os.path.splitdrive(dn)[1] != os.sep and \ 1504 while os.path.splitdrive(dn)[1] != os.sep and \
1505 dn != repodir: 1505 dn != repodir:
1570 ignore=True, update=False) 1570 ignore=True, update=False)
1571 locker.unlock() 1571 locker.unlock()
1572 for file in allFiles: 1572 for file in allFiles:
1573 # file.path is always unicode in Python 2 1573 # file.path is always unicode in Python 2
1574 name = os.path.normcase(file.path) 1574 name = os.path.normcase(file.path)
1575 if file.is_versioned: 1575 if self.__isVersioned(file):
1576 if name in names: 1576 if name in names:
1577 names[name] = self.canBeCommitted 1577 names[name] = self.canBeCommitted
1578 self.statusCache[name] = self.canBeCommitted 1578 self.statusCache[name] = self.canBeCommitted
1579 else: 1579 else:
1580 self.statusCache[name] = self.canBeAdded 1580 self.statusCache[name] = self.canBeAdded
1581 except pysvn.ClientError: 1581 except pysvn.ClientError:
1582 locker.unlock() # ignore pysvn errors 1582 locker.unlock() # ignore pysvn errors
1583 1583
1584 return names 1584 return names
1585
1586 def __isVersioned(self, status):
1587 """
1588 Private method to check, if the given status indicates a
1589 versioned state.
1590
1591 @param status status object to check (pysvn.PysvnStatus)
1592 @return flag indicating a versioned state (boolean)
1593 """
1594 return status["text_status"] in [
1595 pysvn.wc_status_kind.normal,
1596 pysvn.wc_status_kind.added,
1597 pysvn.wc_status_kind.missing,
1598 pysvn.wc_status_kind.deleted,
1599 pysvn.wc_status_kind.replaced,
1600 pysvn.wc_status_kind.modified,
1601 pysvn.wc_status_kind.merged,
1602 pysvn.wc_status_kind.conflicted,
1603 ]
1585 1604
1586 def clearStatusCache(self): 1605 def clearStatusCache(self):
1587 """ 1606 """
1588 Public method to clear the status cache. 1607 Public method to clear the status cache.
1589 """ 1608 """
2459 except pysvn.ClientError: 2478 except pysvn.ClientError:
2460 pass 2479 pass
2461 locker.unlock() 2480 locker.unlock()
2462 2481
2463 return changelists 2482 return changelists
2483
2484 def svnUpgrade(self, path):
2485 """
2486 Public method to upgrade the working copy format.
2487
2488 @param path directory name to show change lists for (string)
2489 """
2490 client = self.getClient()
2491 dlg = \
2492 SvnDialog(self.trUtf8('Upgrade'),
2493 "upgrade {0}".format(path),
2494 client)
2495 QApplication.processEvents()
2496 locker = QMutexLocker(self.vcsExecutionMutex)
2497 try:
2498 client.upgrade(path)
2499 except pysvn.ClientError as e:
2500 dlg.showError(e.args[0])
2501 locker.unlock()
2502 dlg.finish()
2503 dlg.exec_()
2464 2504
2465 ########################################################################### 2505 ###########################################################################
2466 ## Private Subversion specific methods are below. 2506 ## Private Subversion specific methods are below.
2467 ########################################################################### 2507 ###########################################################################
2468 2508

eric ide

mercurial