##// END OF EJS Templates
bookmarks: introduce a repo._bookmarks.changectx(mark) method and use it...
Martin von Zweigbergk -
r37468:81d35d5d default
parent child Browse files
Show More
@@ -119,6 +119,9 b' class bmstore(dict):'
119 def update(self, *others):
119 def update(self, *others):
120 raise error.ProgrammingError("use 'bookmarks.applychanges' instead")
120 raise error.ProgrammingError("use 'bookmarks.applychanges' instead")
121
121
122 def changectx(self, mark):
123 return self._repo[self[mark]]
124
122 def applychanges(self, repo, tr, changes):
125 def applychanges(self, repo, tr, changes):
123 """Apply a list of changes to bookmarks
126 """Apply a list of changes to bookmarks
124 """
127 """
@@ -212,8 +215,8 b' class bmstore(dict):'
212 return []
215 return []
213 rev = self._repo[target].rev()
216 rev = self._repo[target].rev()
214 anc = self._repo.changelog.ancestors([rev])
217 anc = self._repo.changelog.ancestors([rev])
215 bmctx = self._repo[self[mark]]
218 bmctx = self.changectx(mark)
216 divs = [self._repo[b].node() for b in self
219 divs = [self[b] for b in self
217 if b.split('@', 1)[0] == mark.split('@', 1)[0]]
220 if b.split('@', 1)[0] == mark.split('@', 1)[0]]
218
221
219 # allow resolving a single divergent bookmark even if moving
222 # allow resolving a single divergent bookmark even if moving
@@ -370,11 +373,11 b' def update(repo, parents, node):'
370 bmchanges = []
373 bmchanges = []
371 if marks[active] in parents:
374 if marks[active] in parents:
372 new = repo[node]
375 new = repo[node]
373 divs = [repo[b] for b in marks
376 divs = [marks.changectx(b) for b in marks
374 if b.split('@', 1)[0] == active.split('@', 1)[0]]
377 if b.split('@', 1)[0] == active.split('@', 1)[0]]
375 anc = repo.changelog.ancestors([new.rev()])
378 anc = repo.changelog.ancestors([new.rev()])
376 deletefrom = [b.node() for b in divs if b.rev() in anc or b == new]
379 deletefrom = [b.node() for b in divs if b.rev() in anc or b == new]
377 if validdest(repo, repo[marks[active]], new):
380 if validdest(repo, marks.changectx(active), new):
378 bmchanges.append((active, new.node()))
381 bmchanges.append((active, new.node()))
379
382
380 for bm in divergent2delete(repo, deletefrom, active):
383 for bm in divergent2delete(repo, deletefrom, active):
General Comments 0
You need to be logged in to leave comments. Login now