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