about summary refs log tree commit diff stats
path: root/ranger/fsobject/directory.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2013-02-24 23:24:00 +0100
committerhut <hut@lavabit.com>2013-02-24 23:24:00 +0100
commit6e46fd77cc8674e3ea3603a66981ce1c6abc3d18 (patch)
treedbfc86b9c63f2717c0a8396cc55adfb68172fdae /ranger/fsobject/directory.py
parentb108021d64010dbd4677dc24729680a8ab90fb04 (diff)
downloadranger-6e46fd77cc8674e3ea3603a66981ce1c6abc3d18.tar.gz
vcs: move some code from load_bit_by_bit to load_vcs
Diffstat (limited to 'ranger/fsobject/directory.py')
-rw-r--r--ranger/fsobject/directory.py31
1 files changed, 3 insertions, 28 deletions
diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py
index 9bd728c1..546fc6d0 100644
--- a/ranger/fsobject/directory.py
+++ b/ranger/fsobject/directory.py
@@ -16,7 +16,6 @@ from ranger.core.shared import SettingsAware
 from ranger.ext.accumulator import Accumulator
 from ranger.ext.lazy_property import lazy_property
 from ranger.ext.human_readable import human_readable
-from ranger.ext.vcs import VcsError
 from ranger.container.settingobject import LocalSettingObject
 
 def sort_by_basename(path):
@@ -71,7 +70,7 @@ class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware):
     content_outdated = False
     content_loaded = False
 
-    has_vcschild=False
+    has_vcschild = False
 
     _cumulative_size_calculated = False
 
@@ -259,32 +258,8 @@ class Directory(FileSystemObject, Accumulator, Loadable, SettingsAware):
                     # Load vcs data
                     if self.settings.vcs_aware:
                         item.load_vcs()
-                        if item.vcs:
-                            if item.vcs.vcsname == 'git':   backend_state = self.settings.vcs_backend_git
-                            elif item.vcs.vcsname == 'hg':  backend_state = self.settings.vcs_backend_hg
-                            elif item.vcs.vcsname == 'bzr': backend_state = self.settings.vcs_backend_bzr
-                            else:                           backend_state = 'disabled'
-
-                            if backend_state in set(['enabled', 'local']):
-                                self.has_vcschild = True
-                                try:
-                                    if self.vcs_outdated or item.vcs_outdated:
-                                        item.vcs_outdated = False
-                                        item.vcs.get_status()  # caches the file status for get_file_status()
-                                        item.vcsbranch = item.vcs.get_branch()
-                                        item.vcshead = item.vcs.get_info(item.vcs.HEAD)
-                                        if item.path == item.vcs.root and backend_state == 'enabled':
-                                            item.vcsremotestatus = item.vcs.get_remote_status()
-                                    else:
-                                        item.vcsbranch = self.vcsbranch
-                                        item.vcshead = self.vcshead
-                                    item.vcsfilestatus = item.vcs.get_file_status(item.path)
-                                except VcsError as err:
-                                    item.vcsbranch = None
-                                    item.vcshead = None
-                                    item.vcsremotestatus = 'unknown'
-                                    item.vcsfilestatus = 'unknown'
-                                    self.fm.notify("Can not load vcs data on %s: %s" % (item.path, err), bad=True)
+                        if item.vcs_enabled:
+                            self.has_vcschild = True
 
                     files.append(item)
                     self.percent = 100 * len(files) // len(filenames)
ut@lavabit.com> 2010-03-21 03:52:58 +0100 updated TODO and pydoc' href='/akspecs/ranger/commit/doc/pydoc/ranger.gui.widgets.browsercolumn.html?h=v1.9.2&id=c776804d9db1f0ae837aaafe8ed27eb47bb369f5'>c776804d ^
4c13e1f2 ^


















b3556b21 ^

4c13e1f2 ^





4c13e1f2 ^









34a60763 ^

b3556b21 ^
4c13e1f2 ^
b3556b21 ^
4c13e1f2 ^




















62cd83ba ^

4c13e1f2 ^










4c13e1f2 ^





















34a60763 ^
4c13e1f2 ^
34a60763 ^
4c13e1f2 ^




62cd83ba ^
4c13e1f2 ^
b3556b21 ^










34a60763 ^






c776804d ^
4c13e1f2 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190