eric6/Plugins/VcsPlugins/vcsPySvn/SvnStatusMonitorThread.py

changeset 7260
4cc6f121119a
parent 7229
53054eb5b15a
child 7360
9190402e4505
equal deleted inserted replaced
7259:7c017076c12e 7260:4cc6f121119a
55 """ 55 """
56 self.shouldUpdate = False 56 self.shouldUpdate = False
57 57
58 client = pysvn.Client() 58 client = pysvn.Client()
59 client.exception_style = 1 59 client.exception_style = 1
60 client.callback_get_login = \ 60 client.callback_get_login = self.__clientLoginCallback
61 self.__clientLoginCallback 61 client.callback_ssl_server_trust_prompt = (
62 client.callback_ssl_server_trust_prompt = \
63 self.__clientSslServerTrustPromptCallback 62 self.__clientSslServerTrustPromptCallback
63 )
64 64
65 cwd = os.getcwd() 65 cwd = os.getcwd()
66 os.chdir(self.projectDir) 66 os.chdir(self.projectDir)
67 try: 67 try:
68 allFiles = client.status( 68 allFiles = client.status(
70 update=not Preferences.getVCS("MonitorLocalStatus")) 70 update=not Preferences.getVCS("MonitorLocalStatus"))
71 states = {} 71 states = {}
72 for file in allFiles: 72 for file in allFiles:
73 uptodate = True 73 uptodate = True
74 if file.repos_text_status != pysvn.wc_status_kind.none: 74 if file.repos_text_status != pysvn.wc_status_kind.none:
75 uptodate = uptodate and \ 75 uptodate = (
76 uptodate and
76 file.repos_text_status != pysvn.wc_status_kind.modified 77 file.repos_text_status != pysvn.wc_status_kind.modified
78 )
77 if file.repos_prop_status != pysvn.wc_status_kind.none: 79 if file.repos_prop_status != pysvn.wc_status_kind.none:
78 uptodate = uptodate and \ 80 uptodate = (
81 uptodate and
79 file.repos_prop_status != pysvn.wc_status_kind.modified 82 file.repos_prop_status != pysvn.wc_status_kind.modified
83 )
80 84
81 status = "" 85 status = ""
82 if not uptodate: 86 if not uptodate:
83 status = "U" 87 status = "U"
84 self.shouldUpdate = True 88 self.shouldUpdate = True
85 elif file.text_status == pysvn.wc_status_kind.conflicted or \ 89 elif (
86 file.prop_status == pysvn.wc_status_kind.conflicted: 90 file.text_status == pysvn.wc_status_kind.conflicted or
91 file.prop_status == pysvn.wc_status_kind.conflicted
92 ):
87 status = "Z" 93 status = "Z"
88 elif file.text_status == pysvn.wc_status_kind.deleted or \ 94 elif (
89 file.prop_status == pysvn.wc_status_kind.deleted: 95 file.text_status == pysvn.wc_status_kind.deleted or
96 file.prop_status == pysvn.wc_status_kind.deleted
97 ):
90 status = "O" 98 status = "O"
91 elif file.text_status == pysvn.wc_status_kind.modified or \ 99 elif (
92 file.prop_status == pysvn.wc_status_kind.modified: 100 file.text_status == pysvn.wc_status_kind.modified or
101 file.prop_status == pysvn.wc_status_kind.modified
102 ):
93 status = "M" 103 status = "M"
94 elif file.text_status == pysvn.wc_status_kind.added or \ 104 elif (
95 file.prop_status == pysvn.wc_status_kind.added: 105 file.text_status == pysvn.wc_status_kind.added or
106 file.prop_status == pysvn.wc_status_kind.added
107 ):
96 status = "A" 108 status = "A"
97 elif file.text_status == pysvn.wc_status_kind.replaced or \ 109 elif (
98 file.prop_status == pysvn.wc_status_kind.replaced: 110 file.text_status == pysvn.wc_status_kind.replaced or
111 file.prop_status == pysvn.wc_status_kind.replaced
112 ):
99 status = "R" 113 status = "R"
100 if status: 114 if status:
101 states[file.path] = status 115 states[file.path] = status
102 try: 116 try:
103 if self.reportedStates[file.path] != status: 117 if self.reportedStates[file.path] != status:

eric ide

mercurial