##// END OF EJS Templates
fixes #645 Fix git handler when doing delete remote branch...
marcink -
r2998:433428ff beta
parent child Browse files
Show More
@@ -521,10 +521,23 def action_parser(user_log, feed=False,
521
521
522 def lnk(rev, repo_name):
522 def lnk(rev, repo_name):
523 if isinstance(rev, BaseChangeset) or isinstance(rev, AttributeDict):
523 if isinstance(rev, BaseChangeset) or isinstance(rev, AttributeDict):
524 lbl = '%s' % (rev.short_id[:8])
524 lazy_cs = True
525 _url = url('changeset_home', repo_name=repo_name,
525 if getattr(rev, 'op', None) and getattr(rev, 'ref_name', None):
526 revision=rev.raw_id)
526 lazy_cs = False
527 title = tooltip(rev.message)
527 lbl = '?'
528 if rev.op == 'delete_branch':
529 lbl = '%s' % _('Deleted branch: %s') % rev.ref_name
530 title = ''
531 elif rev.op == 'tag':
532 lbl = '%s' % _('Created tag: %s') % rev.ref_name
533 title = ''
534 _url = '#'
535
536 else:
537 lbl = '%s' % (rev.short_id[:8])
538 _url = url('changeset_home', repo_name=repo_name,
539 revision=rev.raw_id)
540 title = tooltip(rev.message)
528 else:
541 else:
529 ## changeset cannot be found/striped/removed etc.
542 ## changeset cannot be found/striped/removed etc.
530 lbl = ('%s' % rev)[:12]
543 lbl = ('%s' % rev)[:12]
@@ -533,12 +546,16 def action_parser(user_log, feed=False,
533 if parse_cs:
546 if parse_cs:
534 return link_to(lbl, _url, title=title, class_='tooltip')
547 return link_to(lbl, _url, title=title, class_='tooltip')
535 return link_to(lbl, _url, raw_id=rev.raw_id, repo_name=repo_name,
548 return link_to(lbl, _url, raw_id=rev.raw_id, repo_name=repo_name,
536 class_='lazy-cs')
549 class_='lazy-cs' if lazy_cs else '')
537
550
538 revs = []
551 revs = []
539 if len(filter(lambda v: v != '', revs_ids)) > 0:
552 if len(filter(lambda v: v != '', revs_ids)) > 0:
540 repo = None
553 repo = None
541 for rev in revs_ids[:revs_top_limit]:
554 for rev in revs_ids[:revs_top_limit]:
555 _op = _name = None
556 if len(rev.split('=>')) == 2:
557 _op, _name = rev.split('=>')
558
542 # we want parsed changesets, or new log store format is bad
559 # we want parsed changesets, or new log store format is bad
543 if parse_cs:
560 if parse_cs:
544 try:
561 try:
@@ -555,6 +572,8 def action_parser(user_log, feed=False,
555 'short_id': rev[:12],
572 'short_id': rev[:12],
556 'raw_id': rev,
573 'raw_id': rev,
557 'message': '',
574 'message': '',
575 'op': _op,
576 'ref_name': _name
558 })
577 })
559 revs.append(_rev)
578 revs.append(_rev)
560 cs_links = []
579 cs_links = []
@@ -412,11 +412,17 def handle_git_receive(repo_path, revs,
412 heads.splitlines()))
412 heads.splitlines()))
413 cmd = (('log %(new_rev)s' % push_ref) +
413 cmd = (('log %(new_rev)s' % push_ref) +
414 ' --reverse --pretty=format:"%H" --not ' + heads)
414 ' --reverse --pretty=format:"%H" --not ' + heads)
415 git_revs += repo.run_git_command(cmd)[0].splitlines()
416
417 elif push_ref['new_rev'] == EmptyChangeset().raw_id:
418 #delete branch case
419 git_revs += ['delete_branch=>%s' % push_ref['name']]
415 else:
420 else:
416 cmd = (('log %(old_rev)s..%(new_rev)s' % push_ref) +
421 cmd = (('log %(old_rev)s..%(new_rev)s' % push_ref) +
417 ' --reverse --pretty=format:"%H"')
422 ' --reverse --pretty=format:"%H"')
418 git_revs += repo.run_git_command(cmd)[0].splitlines()
423 git_revs += repo.run_git_command(cmd)[0].splitlines()
424
419 elif _type == 'tags':
425 elif _type == 'tags':
420 git_revs += [push_ref['name']]
426 git_revs += ['tag=>%s' % push_ref['name']]
421
427
422 log_push_action(baseui, repo, _git_revs=git_revs)
428 log_push_action(baseui, repo, _git_revs=git_revs)
General Comments 0
You need to be logged in to leave comments. Login now