Skip to content

Commit

Permalink
Add branch create, history and commit undo + Fix segfault on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
trollodel committed Sep 4, 2020
1 parent e9fe1c1 commit dac45e3
Show file tree
Hide file tree
Showing 7 changed files with 1,192 additions and 455 deletions.
32 changes: 26 additions & 6 deletions spyder/plugins/vcs/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,16 @@ class VCS(SpyderDockablePlugin): # pylint: disable=W0201
vcs_type: str
The canonical name for the VCS. Common names are: git, mercurial.
"""

sig_branch_changed = Signal(str)
"""
This signal is emitted when the current branch change
Notes
-----
Emit this signal does not change the repository
as it is changed before normal emission.
To change the repository itself use
:py:meth:`VCS.set_repository_root` instead.
Parameters
----------
branchname: str
The current branch name in the VCS.
"""

# Actions defintion
Expand Down Expand Up @@ -231,6 +234,23 @@ def set_repository(self, repository_dir: str) -> str:
set_repository,
doc="A property shorthand for get_repository and set_repository")

def select_branch(self, branchname: str) -> None:
"""
Select a branch given its name.
Parameters
----------
branchname : str, optional
The branch name.
Raises
------
AttributeError
If changing branch is not supported.
"""
self.get_widget().select_branch(branchname)

# Private methods
def _create_actions(self):
# TODO: Add tips
create_action = self.create_action
Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/vcs/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Distributed under the terms of the MIT License
# (see spyder/__init__.py for details)
# -----------------------------------------------------------------------------
"""Spyder VCS backend and utils."""
"""Spyder VCS backend and utils."""
Loading

0 comments on commit dac45e3

Please sign in to comment.