Przeglądaj źródła

Adds push to unpublished commits

Adds push to unpublished file commits in history views
main
Eric Amodio 4 lat temu
rodzic
commit
b6df6b2df7
3 zmienionych plików z 26 dodań i 9 usunięć
  1. +2
    -1
      CHANGELOG.md
  2. +22
    -6
      package.json
  3. +2
    -2
      src/views/viewCommands.ts

+ 2
- 1
CHANGELOG.md Wyświetl plik

@ -14,7 +14,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Adds this new option to the _Menus & Toolbars_ section of the GitLens Interactive Settings
- Adds an _Open File on Remote From..._ command (`gitlens.openFileOnRemoteFrom`) to open a file or revision on a specific branch or tag on the remote provider — closes [#1071](https://github.com/eamodio/vscode-gitlens/issues/1071)
- Adds a _Copy Remote File Url From..._ command (`gitlens.copyRemoteFileUrlFrom`) to copy the url of a file or revision on a specific branch or tag the remote provider — closes [#1071](https://github.com/eamodio/vscode-gitlens/issues/1071)
- Adds _Commit_ submenu to files in the _File History_ and _Line History_ views — closes [#1044](https://github.com/eamodio/vscode-gitlens/issues/1044)
- Adds a _Commit_ submenu to files in the _File History_ and _Line History_ views — closes [#1044](https://github.com/eamodio/vscode-gitlens/issues/1044)
- Adds a _Push to Commit..._ command to unpublished commits in the _Commits_, _Branches_, and _Repositories_ views, and to to unpublished files in the _File History_ and _Line History_ views
- Adds a welcome, i.e. richer empty state, to the _Search & Compare_ view
- Adds preview extensibility APIs
- Adds a preview _action runner_ extensibility point to provide a runner (handler) for a new _createPullRequest_ and _openPullRequest_ actions — see `gitlens.d.ts` for API definitions

+ 22
- 6
package.json Wyświetl plik

@ -3716,7 +3716,8 @@
{
"command": "gitlens.views.pushToCommit",
"title": "Push to Commit...",
"category": "GitLens"
"category": "GitLens",
"icon": "$(arrow-up)"
},
{
"command": "gitlens.views.rebaseOntoBranch",
@ -6620,6 +6621,11 @@
{
"command": "gitlens.views.undoCommit",
"when": "!gitlens:readonly && viewItem =~ /gitlens:commit\\b(?=.*?\\b\\+HEAD\\b)(?=.*?\\b\\+unpublished\\b)/",
"group": "inline@95"
},
{
"command": "gitlens.views.pushToCommit",
"when": "!gitlens:readonly && viewItem =~ /gitlens:commit\\b(?=.*?\\b\\+current\\b)(?=.*?\\b\\+unpublished\\b)/",
"group": "inline@96"
},
{
@ -6818,22 +6824,22 @@
"group": "1_gitlens_actions@1"
},
{
"command": "gitlens.views.revert",
"when": "!gitlens:readonly && viewItem =~ /gitlens:commit\\b(?=.*?\\b\\+current\\b)/",
"command": "gitlens.views.pushToCommit",
"when": "!gitlens:readonly && viewItem =~ /gitlens:commit\\b(?=.*?\\b\\+current\\b)(?=.*?\\b\\+unpublished\\b)/",
"group": "1_gitlens_actions@2"
},
{
"command": "gitlens.views.resetToCommit",
"command": "gitlens.views.revert",
"when": "!gitlens:readonly && viewItem =~ /gitlens:commit\\b(?=.*?\\b\\+current\\b)/",
"group": "1_gitlens_actions@3"
},
{
"command": "gitlens.views.resetCommit",
"command": "gitlens.views.resetToCommit",
"when": "!gitlens:readonly && viewItem =~ /gitlens:commit\\b(?=.*?\\b\\+current\\b)/",
"group": "1_gitlens_actions@4"
},
{
"command": "gitlens.views.pushToCommit",
"command": "gitlens.views.resetCommit",
"when": "!gitlens:readonly && viewItem =~ /gitlens:commit\\b(?=.*?\\b\\+current\\b)/",
"group": "1_gitlens_actions@5"
},
@ -6891,6 +6897,11 @@
{
"command": "gitlens.views.undoCommit",
"when": "!gitlens:readonly && viewItem =~ /gitlens:file\\b(?=.*?\\b\\+committed\\b)(?=.*?\\b\\+HEAD\\b)(?=.*?\\b\\+unpublished\\b)/",
"group": "inline@-2"
},
{
"command": "gitlens.views.pushToCommit",
"when": "!gitlens:readonly && viewItem =~ /gitlens:file\\b(?=.*?\\b\\+committed\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+unpublished\\b)/",
"group": "inline@-1"
},
{
@ -7576,6 +7587,11 @@
],
"gitlens/commit/file/commit": [
{
"command": "gitlens.views.pushToCommit",
"when": "!gitlens:readonly && viewItem =~ /gitlens:file\\b(?=.*?\\b\\+committed\\b)(?=.*?\\b\\+current\\b)(?=.*?\\b\\+unpublished\\b)/",
"group": "1_gitlens_actions@0"
},
{
"command": "gitlens.views.revert",
"when": "!gitlens:readonly && viewItem =~ /gitlens:file\\b(?=.*?\\b\\+committed\\b)(?=.*?\\b\\+current\\b)/",
"group": "1_gitlens_actions@3"

+ 2
- 2
src/views/viewCommands.ts Wyświetl plik

@ -378,8 +378,8 @@ export class ViewCommands {
}
@debug()
private pushToCommit(node: CommitNode) {
if (!(node instanceof CommitNode)) return Promise.resolve();
private pushToCommit(node: CommitNode | CommitFileNode) {
if (!(node instanceof CommitNode) && !(node instanceof CommitFileNode)) return Promise.resolve();
return GitActions.push(node.repoPath, false, node.commit);
}

Ładowanie…
Anuluj
Zapisz