Plugins/VcsPlugins/vcsPySvn/subversion.py

branch
Py2 comp.
changeset 3060
5883ce99ee12
parent 3058
0a02c433f52d
parent 3051
f08c20c91de7
child 3141
72f3bde98c58
diff -r 0a02c433f52d -r 5883ce99ee12 Plugins/VcsPlugins/vcsPySvn/subversion.py
--- a/Plugins/VcsPlugins/vcsPySvn/subversion.py	Fri Nov 01 15:48:48 2013 +0100
+++ b/Plugins/VcsPlugins/vcsPySvn/subversion.py	Sun Nov 03 15:58:22 2013 +0100
@@ -312,8 +312,8 @@
                 dlg.showError(e.args[0])
         locker.unlock()
         if not noDialog:
-            rev and dlg.showMessage(self.trUtf8("Imported revision {0}.\n")\
-                                          .format(rev.number))
+            rev and dlg.showMessage(self.trUtf8("Imported revision {0}.\n")
+                                    .format(rev.number))
             dlg.finish()
             dlg.exec_()
         os.chdir(cwd)
@@ -373,7 +373,7 @@
                 self.trUtf8('Checking project out of Subversion repository'),
                 "checkout{0} {1} {2}".format(
                     (not recurse) and " --non-recursive" or "",
-                     url, projectDir),
+                    url, projectDir),
                 client)
             QApplication.processEvents()
         locker = QMutexLocker(self.vcsExecutionMutex)
@@ -437,7 +437,7 @@
             self.trUtf8('Exporting project from Subversion repository'),
             "export --force{0} {1} {2}".format(
                 (not recurse) and " --non-recursive" or "",
-                 url, projectDir),
+                url, projectDir),
             client)
         QApplication.processEvents()
         locker = QMutexLocker(self.vcsExecutionMutex)
@@ -501,8 +501,8 @@
                     project = e5App().getObject("Project")
                     if nam == project.getProjectPath():
                         ok &= project.checkAllScriptsDirty(
-                                reportSyntaxErrors=True) and \
-                              project.checkDirty()
+                            reportSyntaxErrors=True) and \
+                            project.checkDirty()
                         continue
                 elif os.path.isfile(nam):
                     editor = e5App().getObject("ViewManager")\
@@ -562,8 +562,8 @@
                     (not recurse) and " --non-recursive" or "",
                     keeplocks and " --keep-locks" or "",
                     keepChangelists and " --keep-changelists" or "",
-                    changelists and \
-                        " --changelist ".join([""] + changelists) or "",
+                    changelists and
+                    " --changelist ".join([""] + changelists) or "",
                     msg, " ".join(fnames)),
                 client)
             QApplication.processEvents()
@@ -665,8 +665,8 @@
                 if os.path.splitdrive(repodir)[1] == os.sep:
                     return  # oops, project is not version controlled
             while os.path.normcase(dname) != os.path.normcase(repodir) and \
-                  (os.path.normcase(dname) not in self.statusCache or \
-                   self.statusCache[os.path.normcase(dname)] == 
+                (os.path.normcase(dname) not in self.statusCache or
+                 self.statusCache[os.path.normcase(dname)] ==
                     self.canBeAdded):
                 # add directories recursively, if they aren't in the
                 # repository already
@@ -695,9 +695,9 @@
                             return  # oops, project is not version controlled
                     while os.path.normcase(d) != \
                             os.path.normcase(repodir) and \
-                          (d not in tree2 + tree) and \
-                          (os.path.normcase(d) not in self.statusCache or \
-                           self.statusCache[os.path.normcase(d)] == 
+                        (d not in tree2 + tree) and \
+                        (os.path.normcase(d) not in self.statusCache or
+                         self.statusCache[os.path.normcase(d)] ==
                             self.canBeAdded):
                         tree2.append(d)
                         d = os.path.dirname(d)
@@ -775,9 +775,9 @@
                             return  # oops, project is not version controlled
                     while os.path.normcase(d) != \
                             os.path.normcase(repodir) and \
-                          (d not in tree) and \
-                          (os.path.normcase(d) not in self.statusCache or \
-                           self.statusCache[os.path.normcase(d)] == 
+                        (d not in tree) and \
+                        (os.path.normcase(d) not in self.statusCache or
+                         self.statusCache[os.path.normcase(d)] ==
                             self.canBeAdded):
                         tree.append(d)
                         d = os.path.dirname(d)
@@ -800,8 +800,8 @@
                         return  # oops, project is not version controlled
                 while os.path.normcase(dname) != \
                         os.path.normcase(repodir) and \
-                      (os.path.normcase(dname) not in self.statusCache or \
-                       self.statusCache[os.path.normcase(dname)] == 
+                    (os.path.normcase(dname) not in self.statusCache or
+                     self.statusCache[os.path.normcase(dname)] ==
                         self.canBeAdded):
                     # add directories recursively, if they aren't in the
                     # repository already
@@ -933,10 +933,10 @@
                 dlg = \
                     SvnDialog(
                         self.trUtf8('Moving {0}').format(name),
-                            "move{0}{1} {2} {3}".format(
-                                force and " --force" or "",
-                                log and (" --message {0}".format(log)) or "",
-                                name, target),
+                        "move{0}{1} {2} {3}".format(
+                            force and " --force" or "",
+                            log and (" --message {0}".format(log)) or "",
+                            name, target),
                         client, log=log)
                 QApplication.processEvents()
             locker = QMutexLocker(self.vcsExecutionMutex)
@@ -990,7 +990,7 @@
         Subversion repository.
         
         If name is a directory and is the project directory, all project files
-        are saved first. If name is a file (or list of files), which is/are 
+        are saved first. If name is a file (or list of files), which is/are
         being edited and has unsaved modification, they can be saved or the
         operation may be aborted.
         
@@ -1339,12 +1339,12 @@
         dlg = \
             SvnDialog(
                 self.trUtf8('Merging {0}').format(name),
-                    "merge{0}{1} {2} {3} {4}".format(
-                        (not recurse) and " --non-recursive" or "",
-                        force and " --force" or "",
-                        "{0}{1}".format(url1, rev1 and ("@" + rev1) or ""),
-                        "{0}{1}".format(url2, rev2 and ("@" + rev2) or ""),
-                        fname),
+                "merge{0}{1} {2} {3} {4}".format(
+                    (not recurse) and " --non-recursive" or "",
+                    force and " --force" or "",
+                    "{0}{1}".format(url1, rev1 and ("@" + rev1) or ""),
+                    "{0}{1}".format(url2, rev2 and ("@" + rev2) or ""),
+                    fname),
                 client)
         QApplication.processEvents()
         try:
@@ -1491,7 +1491,7 @@
             try:
                 locker = QMutexLocker(self.vcsExecutionMutex)
                 allFiles = client.status(dname, recurse=True, get_all=True,
-                                              ignore=True, update=False)
+                                         ignore=True, update=False)
                 locker.unlock()
                 dirs = [x for x in names.keys() if os.path.isdir(x)]
                 for file in allFiles:
@@ -1501,7 +1501,7 @@
                             names[name] = self.canBeCommitted
                             dn = name
                             while os.path.splitdrive(dn)[1] != os.sep and \
-                                  dn != repodir:
+                                    dn != repodir:
                                 dn = os.path.dirname(dn)
                                 if dn in self.statusCache and \
                                    self.statusCache[dn] == self.canBeCommitted:
@@ -1566,7 +1566,7 @@
             try:
                 locker = QMutexLocker(self.vcsExecutionMutex)
                 allFiles = client.status(dname, recurse=True, get_all=True,
-                                              ignore=True, update=False)
+                                         ignore=True, update=False)
                 locker.unlock()
                 for file in allFiles:
                     name = os.path.normcase(file.path)
@@ -1719,7 +1719,7 @@
             """<tr><td><b>Comitted time</b></td><td>{7}</td></tr>"""
             """<tr><td><b>Last author</b></td><td>{8}</td></tr>"""
             """</table>"""
-            )\
+        )\
             .format(".".join([str(v) for v in pysvn.version]),
                     ".".join([str(v) for v in pysvn.svn_version[:3]]),
                     apiVersion,
@@ -1731,7 +1731,7 @@
                     time.strftime(
                         "%H:%M:%S %Z", time.localtime(entry.commit_time)),
                     entry.commit_author
-            )
+                    )
     
     ###########################################################################
     ## Public Subversion specific methods are below.
@@ -1815,9 +1815,9 @@
             dlg = \
                 SvnDialog(
                     self.trUtf8('Copying {0}').format(name),
-                        "copy{0} {1} {2}".format(
-                            log and (" --message {0}".format(log)) or "",
-                            name, target),
+                    "copy{0} {1} {2}".format(
+                        log and (" --message {0}".format(log)) or "",
+                        name, target),
                     client, log=log)
             QApplication.processEvents()
             locker = QMutexLocker(self.vcsExecutionMutex)
@@ -1886,11 +1886,11 @@
             dlg = \
                 SvnDialog(
                     self.trUtf8('Subversion Set Property'),
-                        "propset{0}{1} {2} {3} {4}".format(
-                            recurse and " --recurse" or "",
-                            skipchecks and " --skip-checks" or "",
-                            propName, propValue,
-                            " ".join(fnames)),
+                    "propset{0}{1} {2} {3} {4}".format(
+                        recurse and " --recurse" or "",
+                        skipchecks and " --skip-checks" or "",
+                        propName, propValue,
+                        " ".join(fnames)),
                     client)
             QApplication.processEvents()
             try:
@@ -1940,10 +1940,10 @@
             dlg = \
                 SvnDialog(
                     self.trUtf8('Subversion Delete Property'),
-                        "propdel{0}{1} {2} {3}".format(
-                            recurse and " --recurse" or "",
-                            skipchecks and " --skip-checks" or "",
-                            propName, " ".join(fnames)),
+                    "propdel{0}{1} {2} {3}".format(
+                        recurse and " --recurse" or "",
+                        skipchecks and " --skip-checks" or "",
+                        propName, " ".join(fnames)),
                     client)
             QApplication.processEvents()
             try:
@@ -2175,7 +2175,7 @@
                     self.trUtf8("Subversion Side-by-Side Difference"),
                     self.trUtf8(
                         """<p>The file <b>{0}</b> could not be read.</p>""")
-                        .format(name))
+                    .format(name))
                 return
         
         if self.sbsDiff is None:
@@ -2230,10 +2230,10 @@
         dlg = \
             SvnDialog(
                 self.trUtf8('Locking in the Subversion repository'),
-                    "lock{0}{1} {2}".format(
-                        stealIt and " --force" or "",
-                        comment and (" --message {0}".format(comment)) or "",
-                        " ".join(fnames)),
+                "lock{0}{1} {2}".format(
+                    stealIt and " --force" or "",
+                    comment and (" --message {0}".format(comment)) or "",
+                    " ".join(fnames)),
                 client, parent=parent)
         QApplication.processEvents()
         try:
@@ -2270,9 +2270,9 @@
         dlg = \
             SvnDialog(
                 self.trUtf8('Unlocking in the Subversion repository'),
-                    "unlock{0} {1}".format(
-                        breakIt and " --force" or "",
-                        " ".join(fnames)),
+                "unlock{0} {1}".format(
+                    breakIt and " --force" or "",
+                    " ".join(fnames)),
                 client, parent=parent)
         QApplication.processEvents()
         try:
@@ -2541,7 +2541,11 @@
             os.path.exists(
                 os.path.join(project.getProjectPath(), ".svn", "format")) or \
             os.path.exists(
-                os.path.join(project.getProjectPath(), "_svn", "format"))
+                os.path.join(project.getProjectPath(), "_svn", "format")) or \
+            os.path.exists(
+                os.path.join(project.getProjectPath(), ".svn", "wc.db")) or \
+            os.path.exists(
+                os.path.join(project.getProjectPath(), "_svn", "wc.db"))
         return helper
 
     ###########################################################################

eric ide

mercurial