735 self.statusCache[os.path.normcase(d)] == self.canBeAdded): |
735 self.statusCache[os.path.normcase(d)] == self.canBeAdded): |
736 tree.append(d) |
736 tree.append(d) |
737 d = os.path.dirname(d) |
737 d = os.path.dirname(d) |
738 else: |
738 else: |
739 while not os.path.exists(os.path.join(d, self.adminDir)): |
739 while not os.path.exists(os.path.join(d, self.adminDir)): |
740 # add directories recursively, |
740 # add directories recursively, |
741 # if they aren't in the repository already |
741 # if they aren't in the repository already |
742 if d in tree: |
742 if d in tree: |
743 break |
743 break |
744 tree.append(d) |
744 tree.append(d) |
745 d = os.path.dirname(d) |
745 d = os.path.dirname(d) |
1298 |
1298 |
1299 if name in self.statusCache: |
1299 if name in self.statusCache: |
1300 return self.statusCache[name] |
1300 return self.statusCache[name] |
1301 |
1301 |
1302 name = os.path.normcase(name) |
1302 name = os.path.normcase(name) |
1303 states = { name : 0 } |
1303 states = {name: 0} |
1304 states = self.vcsAllRegisteredStates(states, dname, False) |
1304 states = self.vcsAllRegisteredStates(states, dname, False) |
1305 if states[name] == self.canBeCommitted: |
1305 if states[name] == self.canBeCommitted: |
1306 return self.canBeCommitted |
1306 return self.canBeCommitted |
1307 else: |
1307 else: |
1308 return self.canBeAdded |
1308 return self.canBeAdded |
1350 if self.__wcng: |
1350 if self.__wcng: |
1351 return self.__vcsAllRegisteredStates_wcng(names, dname, shortcut) |
1351 return self.__vcsAllRegisteredStates_wcng(names, dname, shortcut) |
1352 else: |
1352 else: |
1353 return self.__vcsAllRegisteredStates_wc(names, dname, shortcut) |
1353 return self.__vcsAllRegisteredStates_wc(names, dname, shortcut) |
1354 |
1354 |
1355 def __vcsAllRegisteredStates_wcng(self, names, dname, shortcut = True): |
1355 def __vcsAllRegisteredStates_wcng(self, names, dname, shortcut=True): |
1356 """ |
1356 """ |
1357 Private method used to get the registered states of a number of files in the vcs. |
1357 Private method used to get the registered states of a number of files in the vcs. |
1358 |
1358 |
1359 This is the variant for subversion installations using the new working copy |
1359 This is the variant for subversion installations using the new working copy |
1360 meta-data format. |
1360 meta-data format. |
1364 all files has been populated by the previous run. |
1364 all files has been populated by the previous run. |
1365 |
1365 |
1366 @param names dictionary with all filenames to be checked as keys |
1366 @param names dictionary with all filenames to be checked as keys |
1367 @param dname directory to check in (string) |
1367 @param dname directory to check in (string) |
1368 @param shortcut flag indicating a shortcut should be taken (boolean) |
1368 @param shortcut flag indicating a shortcut should be taken (boolean) |
1369 @return the received dictionary completed with a combination of |
1369 @return the received dictionary completed with a combination of |
1370 canBeCommited and canBeAdded or None in order to signal an error |
1370 canBeCommited and canBeAdded or None in order to signal an error |
1371 """ |
1371 """ |
1372 if dname.endswith(os.sep): |
1372 if dname.endswith(os.sep): |
1373 dname = dname[:-1] |
1373 dname = dname[:-1] |
1374 dname = os.path.normcase(dname) |
1374 dname = os.path.normcase(dname) |
1395 client.callback_ssl_server_trust_prompt = \ |
1395 client.callback_ssl_server_trust_prompt = \ |
1396 mixin._clientSslServerTrustPromptCallback |
1396 mixin._clientSslServerTrustPromptCallback |
1397 |
1397 |
1398 try: |
1398 try: |
1399 locker = QMutexLocker(self.vcsExecutionMutex) |
1399 locker = QMutexLocker(self.vcsExecutionMutex) |
1400 allFiles = client.status(dname, recurse = True, get_all = True, |
1400 allFiles = client.status(dname, recurse=True, get_all=True, |
1401 ignore = True, update = False) |
1401 ignore=True, update=False) |
1402 locker.unlock() |
1402 locker.unlock() |
1403 dirs = [x for x in names.keys() if os.path.isdir(x)] |
1403 dirs = [x for x in names.keys() if os.path.isdir(x)] |
1404 for file in allFiles: |
1404 for file in allFiles: |
1405 name = os.path.normcase(file.path) |
1405 name = os.path.normcase(file.path) |
1406 if file.is_versioned: |
1406 if file.is_versioned: |
1427 except pysvn.ClientError: |
1427 except pysvn.ClientError: |
1428 locker.unlock() # ignore pysvn errors |
1428 locker.unlock() # ignore pysvn errors |
1429 |
1429 |
1430 return names |
1430 return names |
1431 |
1431 |
1432 def __vcsAllRegisteredStates_wc(self, names, dname, shortcut = True): |
1432 def __vcsAllRegisteredStates_wc(self, names, dname, shortcut=True): |
1433 """ |
1433 """ |
1434 Private method used to get the registered states of a number of files in the vcs. |
1434 Private method used to get the registered states of a number of files in the vcs. |
1435 |
1435 |
1436 This is the variant for subversion installations using the old working copy |
1436 This is the variant for subversion installations using the old working copy |
1437 meta-data format. |
1437 meta-data format. |
1441 all files has been populated by the previous run. |
1441 all files has been populated by the previous run. |
1442 |
1442 |
1443 @param names dictionary with all filenames to be checked as keys |
1443 @param names dictionary with all filenames to be checked as keys |
1444 @param dname directory to check in (string) |
1444 @param dname directory to check in (string) |
1445 @param shortcut flag indicating a shortcut should be taken (boolean) |
1445 @param shortcut flag indicating a shortcut should be taken (boolean) |
1446 @return the received dictionary completed with a combination of |
1446 @return the received dictionary completed with a combination of |
1447 canBeCommited and canBeAdded or None in order to signal an error |
1447 canBeCommited and canBeAdded or None in order to signal an error |
1448 """ |
1448 """ |
1449 if not os.path.isdir(os.path.join(dname, self.adminDir)): |
1449 if not os.path.isdir(os.path.join(dname, self.adminDir)): |
1450 # not under version control -> do nothing |
1450 # not under version control -> do nothing |
1451 return names |
1451 return names |