comparison hgext/bookmarks.py @ 7489:9b64589b1112

Merge backout
author David Soria Parra <dsp@php.net>
date Sun, 07 Dec 2008 19:33:26 +0100
parents 63446383dfb7 e80a734ba1fc
children b95ff487870e fead6cf99a09
comparison
equal deleted inserted replaced
7487:63446383dfb7 7489:9b64589b1112
290 tagscache.update(parse(repo)) 290 tagscache.update(parse(repo))
291 return tagscache 291 return tagscache
292 292
293 repo.__class__ = bookmark_repo 293 repo.__class__ = bookmark_repo
294 294
295 def pushnonbookmarked(orig, ui, repo, *args, **opts):
296 'Call push with only the heads that are not bookmarked'
297 if opts.get('non_bookmarked'):
298 if opts.get('rev'):
299 heads = [repo.lookup(r) for r in opts.get('rev')]
300 else:
301 heads = repo.heads()
302
303 markheads = parse(repo).values()
304 opts['rev'] = [head for head in heads if not(head in markheads)]
305
306 orig(ui, repo, *args, **opts)
307
308 def updatecurbookmark(orig, ui, repo, *args, **opts): 295 def updatecurbookmark(orig, ui, repo, *args, **opts):
309 '''Set the current bookmark 296 '''Set the current bookmark
310 297
311 If the user updates to a bookmark we update the .hg/bookmarks.current 298 If the user updates to a bookmark we update the .hg/bookmarks.current
312 file. 299 file.
318 setcurrent(repo, rev) 305 setcurrent(repo, rev)
319 return res 306 return res
320 307
321 def uisetup(ui): 308 def uisetup(ui):
322 'Replace push with a decorator to provide --non-bookmarked option' 309 'Replace push with a decorator to provide --non-bookmarked option'
323 entry = extensions.wrapcommand(commands.table, 'push', pushnonbookmarked)
324 entry[1].append(('', 'non-bookmarked', None, _("push all heads that are not bookmarked")))
325 if ui.configbool('bookmarks', 'track.current'): 310 if ui.configbool('bookmarks', 'track.current'):
326 extensions.wrapcommand(commands.table, 'update', updatecurbookmark) 311 extensions.wrapcommand(commands.table, 'update', updatecurbookmark)
327 312
328 cmdtable = { 313 cmdtable = {
329 "bookmarks": 314 "bookmarks":