Example #1
0
 def update_remote_branches(self,*rest):
     """Update the remote branch name when a branch is selected"""
     widget = self.remote_branches
     branches = self.filtered_remote_branches
     selection = qtutils.selected_item(widget, branches)
     if not selection:
         return
     branch = utils.strip_one(selection)
     if branch == 'HEAD':
         return
     self.set_remote_branch(branch)
Example #2
0
 def update_remote_branches(self, *rest):
     """Update the remote branch name when a branch is selected"""
     widget = self.remote_branches
     branches = self.filtered_remote_branches
     selection = qtutils.selected_item(widget, branches)
     if not selection:
         return
     branch = utils.strip_one(selection)
     if branch == 'HEAD':
         return
     self.set_remote_branch(branch)
Example #3
0
 def test_strip_one_basename(self):
     expect = 'git'
     actual = utils.strip_one('git')
     self.assertEqual(expect, actual)
Example #4
0
 def test_strip_one_nested_relpath(self):
     expect = 'bin/git'
     actual = utils.strip_one('local/bin/git')
     self.assertEqual(expect, actual)
Example #5
0
 def test_strip_one_abspath(self):
     expect = 'bin/git'
     actual = utils.strip_one('/usr/bin/git')
     self.assertEqual(expect, actual)
Example #6
0
 def test_strip_one_nested_relpath(self):
     expect = 'bin/git'
     actual = utils.strip_one('local/bin/git')
     self.assertEqual(expect, actual)
Example #7
0
 def test_strip_one_basename(self):
     expect = 'git'
     actual = utils.strip_one('git')
     self.assertEqual(expect, actual)
Example #8
0
 def test_strip_one_abspath(self):
     expect = 'bin/git'
     actual = utils.strip_one('/usr/bin/git')
     self.assertEqual(expect, actual)
Example #9
0
def test_strip_one_basename():
    expect = 'git'
    actual = utils.strip_one('git')
    assert expect == actual
Example #10
0
def test_strip_one_nested_relpath():
    expect = 'bin/git'
    actual = utils.strip_one('local/bin/git')
    assert expect == actual
Example #11
0
def test_strip_one_relpath():
    expect = 'git'
    actual = utils.strip_one('bin/git')
    assert expect == actual
Example #12
0
def test_strip_one_abspath():
    expect = 'bin/git'
    actual = utils.strip_one('/usr/bin/git')
    assert expect == actual