Mercurial > evolve
comparison hgext/obsolete.py @ 71:19e1930587a0
[obsolete] Move extension compat code
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Tue, 13 Sep 2011 21:37:28 +0200 |
parents | af4f7ef0a3c1 |
children | 774932a6cc0d |
comparison
equal
deleted
inserted
replaced
70:af4f7ef0a3c1 | 71:19e1930587a0 |
---|---|
116 ############################# | 116 ############################# |
117 | 117 |
118 def revsetobsolete(repo, subset, x): | 118 def revsetobsolete(repo, subset, x): |
119 args = revset.getargs(x, 0, 0, 'publicheads takes no arguments') | 119 args = revset.getargs(x, 0, 0, 'publicheads takes no arguments') |
120 return [r for r in subset if repo[r].obsolete()] # XXX slow | 120 return [r for r in subset if repo[r].obsolete()] # XXX slow |
121 | |
122 ### Other Extension compat | |
123 ############################ | |
124 | |
125 def concludenode(orig, repo, rev, *args, **kwargs): | |
126 newrev = orig(repo, rev, *args, **kwargs) | |
127 oldnode = repo[rev].node() | |
128 newnode = repo[newrev].node() | |
129 repo.addobsolete(newnode, oldnode) | |
130 return newrev | |
131 | |
121 | 132 |
122 def extsetup(ui): | 133 def extsetup(ui): |
123 revset.symbols["obsolete"] = revsetobsolete | 134 revset.symbols["obsolete"] = revsetobsolete |
124 | 135 |
125 def filterobsoleteout(orig, repo, remote, *args,**kwargs): | 136 def filterobsoleteout(orig, repo, remote, *args,**kwargs): |
177 _obsserialise(repo._obssubrels, tmp) | 188 _obsserialise(repo._obssubrels, tmp) |
178 return {'relations': tmp.getvalue()} | 189 return {'relations': tmp.getvalue()} |
179 | 190 |
180 pushkey.register('obsolete', pushobsolete, listobsolete) | 191 pushkey.register('obsolete', pushobsolete, listobsolete) |
181 | 192 |
182 # New commands | 193 ### New commands |
183 ############################# | 194 ############################# |
184 | 195 |
185 | 196 |
186 def cmddebugobsolete(ui, repo, subject, object): | 197 def cmddebugobsolete(ui, repo, subject, object): |
187 """Add an obsolete relation between a too node | 198 """Add an obsolete relation between a too node |
354 finally: | 365 finally: |
355 release(lock, wlock) | 366 release(lock, wlock) |
356 | 367 |
357 repo.__class__ = obsoletingrepo | 368 repo.__class__ = obsoletingrepo |
358 | 369 |
359 | |
360 ### Other Extension compat | |
361 ############################ | |
362 | |
363 def concludenode(orig, repo, rev, *args, **kwargs): | |
364 newrev = orig(repo, rev, *args, **kwargs) | |
365 oldnode = repo[rev].node() | |
366 newnode = repo[newrev].node() | |
367 repo.addobsolete(newnode, oldnode) | |
368 return newrev | |
369 |