Example #1
0
def browse_other():
    """Prompt for a branch and inspect content at that point in time."""
    # Prompt for a branch to browse
    branch = choose_from_combo('Browse Revision...', gitcmds.all_refs())
    if not branch:
        return
    BrowseDialog.browse(branch)
Example #2
0
 def browse_other(self):
     """Prompt for a branch and inspect content at that point in time."""
     # Prompt for a branch to browse
     branch = choose_from_combo('Browse Revision...', gitcmds.all_refs())
     if not branch:
         return
     # Launch the repobrowser
     browse_git_branch(branch)
Example #3
0
 def test_all_refs_split(self):
     self.git('branch', 'a')
     self.git('branch', 'b')
     self.git('branch', 'c')
     self.git('tag', 'd')
     self.git('tag', 'e')
     self.git('tag', 'f')
     self.git('remote', 'add', 'origin', '.')
     self.git('fetch', 'origin')
     local, remote, tags = gitcmds.all_refs(split=True)
     self.assertEqual(local, ['a', 'b', 'c', 'master'])
     self.assertEqual(remote, ['origin/a', 'origin/b', 'origin/c', 'origin/master'])
     self.assertEqual(tags, ['d', 'e', 'f'])
Example #4
0
 def test_all_refs(self):
     self.git('branch', 'a')
     self.git('branch', 'b')
     self.git('branch', 'c')
     self.git('tag', 'd')
     self.git('tag', 'e')
     self.git('tag', 'f')
     self.git('remote', 'add', 'origin', '.')
     self.git('fetch', 'origin')
     refs = gitcmds.all_refs()
     self.assertEqual(refs, [
         'a', 'b', 'c', 'master', 'origin/a', 'origin/b', 'origin/c',
         'origin/master', 'f', 'e', 'd'
     ])
Example #5
0
 def test_all_refs_split(self):
     self.commit_files()
     self.run_git('branch', 'a')
     self.run_git('branch', 'b')
     self.run_git('branch', 'c')
     self.run_git('tag', 'd')
     self.run_git('tag', 'e')
     self.run_git('tag', 'f')
     self.run_git('remote', 'add', 'origin', '.')
     self.run_git('fetch', 'origin')
     local, remote, tags = gitcmds.all_refs(self.context, split=True)
     self.assertEqual(local, ['a', 'b', 'c', 'main'])
     self.assertEqual(remote, ['origin/a', 'origin/b', 'origin/c', 'origin/main'])
     self.assertEqual(tags, ['f', 'e', 'd'])
Example #6
0
 def test_all_refs(self):
     self.git('branch', 'a')
     self.git('branch', 'b')
     self.git('branch', 'c')
     self.git('tag', 'd')
     self.git('tag', 'e')
     self.git('tag', 'f')
     self.git('remote', 'add', 'origin', '.')
     self.git('fetch', 'origin')
     refs = gitcmds.all_refs()
     self.assertEqual(refs,
                      ['a', 'b', 'c', 'master',
                       'origin/a', 'origin/b', 'origin/c', 'origin/master',
                       'd', 'e', 'f'])
Example #7
0
 def test_all_refs_split(self):
     self.git('branch', 'a')
     self.git('branch', 'b')
     self.git('branch', 'c')
     self.git('tag', 'd')
     self.git('tag', 'e')
     self.git('tag', 'f')
     self.git('remote', 'add', 'origin', '.')
     self.git('fetch', 'origin')
     local, remote, tags = gitcmds.all_refs(split=True)
     self.assertEqual(local, ['a', 'b', 'c', 'master'])
     self.assertEqual(remote,
                      ['origin/a', 'origin/b', 'origin/c', 'origin/master'])
     self.assertEqual(tags, ['d', 'e', 'f'])
Example #8
0
 def test_all_refs_split(self):
     self.shell("""
         git branch a &&
         git branch b &&
         git branch c &&
         git tag d &&
         git tag e &&
         git tag f &&
         git remote add origin . &&
         git fetch origin > /dev/null 2>&1
     """)
     local, remote, tags = gitcmds.all_refs(split=True)
     self.assertEqual(local, ['a', 'b', 'c', 'master'])
     self.assertEqual(remote, ['origin/a', 'origin/b', 'origin/c', 'origin/master'])
     self.assertEqual(tags, ['d', 'e', 'f'])
Example #9
0
 def test_all_refs(self):
     self.shell("""
         git branch a &&
         git branch b &&
         git branch c &&
         git tag d &&
         git tag e &&
         git tag f &&
         git remote add origin . &&
         git fetch origin > /dev/null 2>&1
     """)
     refs = gitcmds.all_refs()
     self.assertEqual(refs,
                      ['a', 'b', 'c', 'master',
                       'origin/a', 'origin/b', 'origin/c', 'origin/master',
                       'd', 'e', 'f'])
Example #10
0
def test_all_refs_split(app_context):
    helper.commit_files()
    helper.run_git('branch', 'a')
    helper.run_git('branch', 'b')
    helper.run_git('branch', 'c')
    helper.run_git('tag', 'd')
    helper.run_git('tag', 'e')
    helper.run_git('tag', 'f')
    helper.run_git('remote', 'add', 'origin', '.')
    helper.run_git('fetch', 'origin')

    local, remote, tags = gitcmds.all_refs(app_context, split=True)

    assert local == ['a', 'b', 'c', 'main']
    assert remote == ['origin/a', 'origin/b', 'origin/c', 'origin/main']
    assert tags == ['f', 'e', 'd']
Example #11
0
 def test_all_refs(self):
     self.shell("""
         git branch a &&
         git branch b &&
         git branch c &&
         git tag d &&
         git tag e &&
         git tag f &&
         git remote add origin . &&
         git fetch origin > /dev/null 2>&1
     """)
     refs = gitcmds.all_refs()
     self.assertEqual(refs, [
         'a', 'b', 'c', 'master', 'origin/a', 'origin/b', 'origin/c',
         'origin/master', 'd', 'e', 'f'
     ])
Example #12
0
 def test_all_refs_split(self):
     self.shell("""
         git branch a &&
         git branch b &&
         git branch c &&
         git tag d &&
         git tag e &&
         git tag f &&
         git remote add origin . &&
         git fetch origin > /dev/null 2>&1
     """)
     local, remote, tags = gitcmds.all_refs(split=True)
     self.assertEqual(local, ['a', 'b', 'c', 'master'])
     self.assertEqual(remote,
                      ['origin/a', 'origin/b', 'origin/c', 'origin/master'])
     self.assertEqual(tags, ['d', 'e', 'f'])
Example #13
0
 def test_all_refs_split(self):
     self.shell(
         """
         git branch a &&
         git branch b &&
         git branch c &&
         git tag d &&
         git tag e &&
         git tag f &&
         git remote add origin . &&
         git fetch origin > /dev/null 2>&1
     """
     )
     local, remote, tags = gitcmds.all_refs(split=True)
     self.assertEqual(local, ["a", "b", "c", "master"])
     self.assertEqual(remote, ["origin/a", "origin/b", "origin/c", "origin/master"])
     self.assertEqual(tags, ["d", "e", "f"])
Example #14
0
 def test_all_refs(self):
     self.shell(
         """
         git branch a &&
         git branch b &&
         git branch c &&
         git tag d &&
         git tag e &&
         git tag f &&
         git remote add origin . &&
         git fetch origin > /dev/null 2>&1
     """
     )
     refs = gitcmds.all_refs()
     self.assertEqual(
         refs, ["a", "b", "c", "master", "origin/a", "origin/b", "origin/c", "origin/master", "d", "e", "f"]
     )
Example #15
0
    def update_status(self):
        # Give observers a chance to respond
        self.notify_message_observers(self.message_about_to_update)
        # This allows us to defer notification until the
        # we finish processing data
        staged_only = self.read_only()
        head = self.head
        notify_enabled = self.notification_enabled
        self.notification_enabled = False

        # Set these early since they are used to calculate 'upstream_changed'.
        self.set_trackedbranch(gitcmds.tracked_branch())
        self.set_currentbranch(gitcmds.current_branch())

        (self.staged,
         self.modified,
         self.unmerged,
         self.untracked,
         self.upstream_changed) = gitcmds.worktree_state(head=head,
                                                staged_only=staged_only)
        # NOTE: the model's unstaged list holds an aggregate of the
        # the modified, unmerged, and untracked file lists.
        self.set_unstaged(self.modified + self.unmerged + self.untracked)
        self.set_remotes(self.git.remote().splitlines())

        local_branches, remote_branches, tags = gitcmds.all_refs(split=True)
        self.set_local_branches(local_branches)
        self.set_remote_branches(remote_branches)
        self.set_tags(tags)

        self.set_revision('')
        self.set_local_branch('')
        self.set_remote_branch('')
        # Re-enable notifications and emit changes
        self.notification_enabled = notify_enabled

        self.read_font_sizes()
        self.notify_observers('staged', 'unstaged')
        self.notify_message_observers(self.message_updated)
Example #16
0
 def _update_branches_and_tags(self):
     local_branches, remote_branches, tags = gitcmds.all_refs(split=True)
     self.local_branches = local_branches
     self.remote_branches = remote_branches
     self.tags = tags
Example #17
0
 def _update_branches_and_tags(self):
     local_branches, remote_branches, tags = gitcmds.all_refs(split=True)
     self.set_local_branches(local_branches)
     self.set_remote_branches(remote_branches)
     self.set_tags(tags)
Example #18
0
 def _update_branches_and_tags(self):
     local_branches, remote_branches, tags = gitcmds.all_refs(split=True)
     self.local_branches = local_branches
     self.remote_branches = remote_branches
     self.tags = tags