##// END OF EJS Templates
mercurial: use hash as vcsserver parameters instead of ints which can change even on a server side when a strip is performed.
marcink -
r3859:08fb3520 default
parent child Browse files
Show More
@@ -71,7 +71,7 b' class MercurialCommit(base.BaseCommit):'
71 71 if not pre_load:
72 72 return
73 73
74 result = self._remote.bulk_request(self.idx, pre_load)
74 result = self._remote.bulk_request(self.raw_id, pre_load)
75 75 for attr, value in result.items():
76 76 if attr in ["author", "branch", "message"]:
77 77 value = safe_unicode(value)
@@ -93,7 +93,7 b' class MercurialCommit(base.BaseCommit):'
93 93
94 94 @LazyProperty
95 95 def branch(self):
96 return safe_unicode(self._remote.ctx_branch(self.idx))
96 return safe_unicode(self._remote.ctx_branch(self.raw_id))
97 97
98 98 @LazyProperty
99 99 def bookmarks(self):
@@ -104,7 +104,7 b' class MercurialCommit(base.BaseCommit):'
104 104
105 105 @LazyProperty
106 106 def message(self):
107 return safe_unicode(self._remote.ctx_description(self.idx))
107 return safe_unicode(self._remote.ctx_description(self.raw_id))
108 108
109 109 @LazyProperty
110 110 def committer(self):
@@ -112,22 +112,22 b' class MercurialCommit(base.BaseCommit):'
112 112
113 113 @LazyProperty
114 114 def author(self):
115 return safe_unicode(self._remote.ctx_user(self.idx))
115 return safe_unicode(self._remote.ctx_user(self.raw_id))
116 116
117 117 @LazyProperty
118 118 def date(self):
119 return utcdate_fromtimestamp(*self._remote.ctx_date(self.idx))
119 return utcdate_fromtimestamp(*self._remote.ctx_date(self.raw_id))
120 120
121 121 @LazyProperty
122 122 def status(self):
123 123 """
124 124 Returns modified, added, removed, deleted files for current commit
125 125 """
126 return self._remote.ctx_status(self.idx)
126 return self._remote.ctx_status(self.raw_id)
127 127
128 128 @LazyProperty
129 129 def _file_paths(self):
130 return self._remote.ctx_list(self.idx)
130 return self._remote.ctx_list(self.raw_id)
131 131
132 132 @LazyProperty
133 133 def _dir_paths(self):
@@ -158,7 +158,7 b' class MercurialCommit(base.BaseCommit):'
158 158 """
159 159 Returns list of parent commits.
160 160 """
161 parents = self._remote.ctx_parents(self.idx)
161 parents = self._remote.ctx_parents(self.raw_id)
162 162 return self._make_commits(parents)
163 163
164 164 def _get_phase_text(self, phase_id):
@@ -170,19 +170,19 b' class MercurialCommit(base.BaseCommit):'
170 170
171 171 @LazyProperty
172 172 def phase(self):
173 phase_id = self._remote.ctx_phase(self.idx)
173 phase_id = self._remote.ctx_phase(self.raw_id)
174 174 phase_text = self._get_phase_text(phase_id)
175 175
176 176 return safe_unicode(phase_text)
177 177
178 178 @LazyProperty
179 179 def obsolete(self):
180 obsolete = self._remote.ctx_obsolete(self.idx)
180 obsolete = self._remote.ctx_obsolete(self.raw_id)
181 181 return obsolete
182 182
183 183 @LazyProperty
184 184 def hidden(self):
185 hidden = self._remote.ctx_hidden(self.idx)
185 hidden = self._remote.ctx_hidden(self.raw_id)
186 186 return hidden
187 187
188 188 @LazyProperty
@@ -190,7 +190,7 b' class MercurialCommit(base.BaseCommit):'
190 190 """
191 191 Returns list of child commits.
192 192 """
193 children = self._remote.ctx_children(self.idx)
193 children = self._remote.ctx_children(self.raw_id)
194 194 return self._make_commits(children)
195 195
196 196 def _fix_path(self, path):
@@ -222,28 +222,28 b' class MercurialCommit(base.BaseCommit):'
222 222 Returns stat mode of the file at the given ``path``.
223 223 """
224 224 path = self._get_filectx(path)
225 if 'x' in self._remote.fctx_flags(self.idx, path):
225 if 'x' in self._remote.fctx_flags(self.raw_id, path):
226 226 return base.FILEMODE_EXECUTABLE
227 227 else:
228 228 return base.FILEMODE_DEFAULT
229 229
230 230 def is_link(self, path):
231 231 path = self._get_filectx(path)
232 return 'l' in self._remote.fctx_flags(self.idx, path)
232 return 'l' in self._remote.fctx_flags(self.raw_id, path)
233 233
234 234 def get_file_content(self, path):
235 235 """
236 236 Returns content of the file at given ``path``.
237 237 """
238 238 path = self._get_filectx(path)
239 return self._remote.fctx_node_data(self.idx, path)
239 return self._remote.fctx_node_data(self.raw_id, path)
240 240
241 241 def get_file_size(self, path):
242 242 """
243 243 Returns size of the file at given ``path``.
244 244 """
245 245 path = self._get_filectx(path)
246 return self._remote.fctx_size(self.idx, path)
246 return self._remote.fctx_size(self.raw_id, path)
247 247
248 248 def get_path_history(self, path, limit=None, pre_load=None):
249 249 """
@@ -251,7 +251,7 b' class MercurialCommit(base.BaseCommit):'
251 251 for which file at given ``path`` has been modified.
252 252 """
253 253 path = self._get_filectx(path)
254 hist = self._remote.node_history(self.idx, path, limit)
254 hist = self._remote.node_history(self.raw_id, path, limit)
255 255 return [
256 256 self.repository.get_commit(commit_id=commit_id, pre_load=pre_load)
257 257 for commit_id in hist]
@@ -261,7 +261,7 b' class MercurialCommit(base.BaseCommit):'
261 261 Returns a generator of four element tuples with
262 262 lineno, commit_id, commit lazy loader and line
263 263 """
264 result = self._remote.fctx_annotate(self.idx, path)
264 result = self._remote.fctx_annotate(self.raw_id, path)
265 265
266 266 for ln_no, commit_id, content in result:
267 267 yield (
@@ -350,14 +350,14 b' class MercurialCommit(base.BaseCommit):'
350 350 Returns a dictionary with submodule information from substate file
351 351 of hg repository.
352 352 """
353 return self._remote.ctx_substate(self.idx)
353 return self._remote.ctx_substate(self.raw_id)
354 354
355 355 @LazyProperty
356 356 def affected_files(self):
357 357 """
358 358 Gets a fast accessible file changes for given commit
359 359 """
360 return self._remote.ctx_files(self.idx)
360 return self._remote.ctx_files(self.raw_id)
361 361
362 362 @property
363 363 def added(self):
General Comments 0
You need to be logged in to leave comments. Login now