Skip to content

Commit

Permalink
smarter branch list
Browse files Browse the repository at this point in the history
  • Loading branch information
testuser committed Jun 6, 2014
1 parent 63d7dc9 commit 0e1d8aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions paylogic/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(self, case_id, *args, **kwargs):
widget = self.fields['target_branch'].widget
widget.options['minimumInputLength'] = 0
widget.options['maximumSelectionSize'] = 1
widget.options['width'] = '200px'

widget.url = widget.options['ajax']['url'] = reverse(
self.fields['target_branch'].widget.view, kwargs=dict(case_id=case_id))
Expand Down
7 changes: 4 additions & 3 deletions paylogic/lookups.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"""Lookups for paylogic customizations."""
import os.path

from django_select2 import Select2View, NO_ERR_RESP
from django.conf import settings

Expand All @@ -18,13 +20,12 @@ def get_results(self, request, term, page, context):
original_branch, settings.ORIGINAL_BRANCH_DEFAULT_PREFIX)

branches = []
if target_branch_is_local:

if os.path.isdir(target_url):
target = GuessVCS(
views.attrdict({'revision': target_revision, 'vcs': target_vcs}), target_url)
try:
branches = target.GetBranches()
except NotImplementedError:
except Exception:
# could be not yet supported by VCS
pass

Expand Down

0 comments on commit 0e1d8aa

Please sign in to comment.