This revision was automatically updated to reflect the committed changes.
Closed by commit rHG2815e0db4c54: zsh_completion: use revsets to exclude this 
rev from suggestions to hg merge (authored by av6, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4426?vs=10716&id=10780

REVISION DETAIL
  https://phab.mercurial-scm.org/D4426

AFFECTED FILES
  contrib/zsh_completion

CHANGE DETAILS

diff --git a/contrib/zsh_completion b/contrib/zsh_completion
--- a/contrib/zsh_completion
+++ b/contrib/zsh_completion
@@ -193,21 +193,13 @@
 
 # likely merge candidates
 _hg_mergerevs() {
-  typeset -a heads
-  local myrev
+  typeset -a heads branches
+  local revset='sort(head() and not ., -rev)'
 
-  heads=(${(f)"$(_hg_cmd heads --template '{rev}:{branch}\\n')"})
-  # exclude own revision
-  myrev=$(_hg_cmd log -r . --template '{rev}:{branch}\\n')
-  heads=(${heads:#$myrev})
-
+  heads=(${(f)"$(_hg_cmd log -r '$revset' --template '{rev}:{branch}\\n')"})
   (( $#heads )) && _describe -t heads 'heads' heads
 
-  branches=(${(f)"$(_hg_cmd heads --template '{branch}\\n')"})
-  # exclude own revision
-  myrev=$(_hg_cmd log -r . --template '{branch}\\n')
-  branches=(${branches:#$myrev})
-
+  branches=(${(S)heads/#*:/})
   (( $#branches )) && _describe -t branches 'branches' branches
 }
 



To: av6, #hg-reviewers, spectral, pulkit
Cc: spectral, mjpieters, mercurial-devel
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to