Esempio n. 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)
Esempio n. 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)
Esempio n. 3
0
 def test_strip_one_basename(self):
     expect = 'git'
     actual = utils.strip_one('git')
     self.assertEqual(expect, actual)
Esempio n. 4
0
 def test_strip_one_nested_relpath(self):
     expect = 'bin/git'
     actual = utils.strip_one('local/bin/git')
     self.assertEqual(expect, actual)
Esempio n. 5
0
 def test_strip_one_abspath(self):
     expect = 'bin/git'
     actual = utils.strip_one('/usr/bin/git')
     self.assertEqual(expect, actual)
Esempio n. 6
0
 def test_strip_one_nested_relpath(self):
     expect = 'bin/git'
     actual = utils.strip_one('local/bin/git')
     self.assertEqual(expect, actual)
Esempio n. 7
0
 def test_strip_one_basename(self):
     expect = 'git'
     actual = utils.strip_one('git')
     self.assertEqual(expect, actual)
Esempio n. 8
0
 def test_strip_one_abspath(self):
     expect = 'bin/git'
     actual = utils.strip_one('/usr/bin/git')
     self.assertEqual(expect, actual)
Esempio n. 9
0
def test_strip_one_basename():
    expect = 'git'
    actual = utils.strip_one('git')
    assert expect == actual
Esempio n. 10
0
def test_strip_one_nested_relpath():
    expect = 'bin/git'
    actual = utils.strip_one('local/bin/git')
    assert expect == actual
Esempio n. 11
0
def test_strip_one_relpath():
    expect = 'git'
    actual = utils.strip_one('bin/git')
    assert expect == actual
Esempio n. 12
0
def test_strip_one_abspath():
    expect = 'bin/git'
    actual = utils.strip_one('/usr/bin/git')
    assert expect == actual