Explorar el Código

Add publish context menu action to local branches in graph (#2619)

main
Ramin Tadayon hace 1 año
cometido por GitHub
padre
commit
ab31b2b397
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: 4AEE18F83AFDEB23
Se han modificado 2 ficheros con 27 adiciones y 0 borrados
  1. +16
    -0
      package.json
  2. +11
    -0
      src/plus/webviews/graph/graphWebview.ts

+ 16
- 0
package.json Ver fichero

@ -6975,6 +6975,13 @@
"enablement": "!operationInProgress"
},
{
"command": "gitlens.graph.publishBranch",
"title": "Publish Branch",
"category": "GitLens",
"icon": "$(cloud-upload)",
"enablement": "!operationInProgress"
},
{
"command": "gitlens.graph.rebaseOntoBranch",
"title": "Rebase Current Branch onto Branch...",
"category": "GitLens",
@ -9181,6 +9188,10 @@
"when": "false"
},
{
"command": "gitlens.graph.publishBranch",
"when": "false"
},
{
"command": "gitlens.graph.rebaseOntoBranch",
"when": "false"
},
@ -11936,6 +11947,11 @@
"alt": "gitlens.copyRemoteBranchUrl"
},
{
"command": "gitlens.graph.publishBranch",
"when": "gitlens:hasRemotes && !gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && webviewItem =~ /gitlens:branch\\b(?!.*?\\b\\+remote\\b)(?!.*?\\b\\+tracking\\b)/",
"group": "8_gitlens_actions@13"
},
{
"command": "gitlens.graph.cherryPick",
"when": "!gitlens:readonly && !gitlens:untrusted && !gitlens:hasVirtualFolders && webviewItem =~ /gitlens:commit\\b(?!.*?\\b\\+current\\b)/",
"group": "1_gitlens_actions@1"

+ 11
- 0
src/plus/webviews/graph/graphWebview.ts Ver fichero

@ -308,6 +308,7 @@ export class GraphWebviewProvider implements WebviewProvider {
registerCommand('gitlens.graph.push', this.push, this),
registerCommand('gitlens.graph.pull', this.pull, this),
registerCommand('gitlens.graph.fetch', this.fetch, this),
registerCommand('gitlens.graph.publishBranch', this.publishBranch, this),
registerCommand('gitlens.graph.switchToAnotherBranch', this.switchToAnother, this),
registerCommand('gitlens.graph.createBranch', this.createBranch, this),
@ -2018,6 +2019,16 @@ export class GraphWebviewProvider implements WebviewProvider {
}
@debug()
private publishBranch(item?: GraphItemContext) {
if (isGraphItemRefContext(item, 'branch')) {
const { ref } = item.webviewItemValue;
return RepoActions.push(ref.repoPath, undefined, ref);
}
return Promise.resolve();
}
@debug()
private rebase(item?: GraphItemContext) {
const ref = this.getGraphItemRef(item);
if (ref == null) return Promise.resolve();

Cargando…
Cancelar
Guardar