Patchwork [2,of,2] hgk: remove no longer needed debug-rev-parse command

login
register
mail settings
Submitter Andrew Shadura
Date March 29, 2015, 4:01 p.m.
Message ID <7a4f33772e85cb69c3ef.1427644872@localhost.localdomain>
Download mbox | patch
Permalink /patch/8345/
State Accepted
Headers show

Comments

Andrew Shadura - March 29, 2015, 4:01 p.m.
# HG changeset patch
# User Andrew Shadura <andrew@shadura.me>
# Date 1427574827 -3600
#      Sat Mar 28 21:33:47 2015 +0100
# Node ID 7a4f33772e85cb69c3ef38054ae7200cc9d33d22
# Parent  2a94f6ac56c89382913ab813846474c301d2b6fb
hgk: remove no longer needed debug-rev-parse command
Augie Fackler - March 30, 2015, 6:33 p.m.
On Sun, Mar 29, 2015 at 06:01:12PM +0200, Andrew Shadura wrote:
> # HG changeset patch
> # User Andrew Shadura <andrew@shadura.me>
> # Date 1427574827 -3600
> #      Sat Mar 28 21:33:47 2015 +0100
> # Node ID 7a4f33772e85cb69c3ef38054ae7200cc9d33d22
> # Parent  2a94f6ac56c89382913ab813846474c301d2b6fb
> hgk: remove no longer needed debug-rev-parse command

Queued these two as well, thanks.

>
> diff --git a/contrib/hgk b/contrib/hgk
> --- a/contrib/hgk
> +++ b/contrib/hgk
> @@ -190,8 +190,8 @@ proc getcommits {rargs} {
>       }
>      }
>      if [catch {
> -	set parse_args [concat --default HEAD $revargs]
> -	set parse_temp [eval exec {$env(HG)} --config ui.report_untrusted=false debug-rev-parse $parse_args]
> +	set parse_args [concat tip $revargs]
> +	set parse_temp [eval exec {$env(HG)} --config ui.report_untrusted=false log --template '{node}\n' $parse_args]
>       regsub -all "\r\n" $parse_temp "\n" parse_temp
>       set parsed_args [split $parse_temp "\n"]
>      } err] {
> diff --git a/hgext/hgk.py b/hgext/hgk.py
> --- a/hgext/hgk.py
> +++ b/hgext/hgk.py
> @@ -301,22 +301,6 @@ def revtree(ui, args, repo, full="tree",
>                  break
>              count += 1
>
> -@command('debug-rev-parse',
> -    [('', 'default', '', _('ignored'))],
> -    _('REV'))
> -def revparse(ui, repo, *revs, **opts):
> -    """parse given revisions"""
> -    def revstr(rev):
> -        if rev == 'HEAD':
> -            rev = 'tip'
> -        return revlog.hex(repo.lookup(rev))
> -
> -    for r in revs:
> -        revrange = r.split(':', 1)
> -        ui.write('%s\n' % revstr(revrange[0]))
> -        if len(revrange) == 2:
> -            ui.write('^%s\n' % revstr(revrange[1]))
> -
>  # git rev-list tries to order things by date, and has the ability to stop
>  # at a given commit without walking the whole repo.  TODO add the stop
>  # parameter
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/contrib/hgk b/contrib/hgk
--- a/contrib/hgk
+++ b/contrib/hgk
@@ -190,8 +190,8 @@  proc getcommits {rargs} {
 	}
     }
     if [catch {
-	set parse_args [concat --default HEAD $revargs]
-	set parse_temp [eval exec {$env(HG)} --config ui.report_untrusted=false debug-rev-parse $parse_args]
+	set parse_args [concat tip $revargs]
+	set parse_temp [eval exec {$env(HG)} --config ui.report_untrusted=false log --template '{node}\n' $parse_args]
 	regsub -all "\r\n" $parse_temp "\n" parse_temp
 	set parsed_args [split $parse_temp "\n"]
     } err] {
diff --git a/hgext/hgk.py b/hgext/hgk.py
--- a/hgext/hgk.py
+++ b/hgext/hgk.py
@@ -301,22 +301,6 @@  def revtree(ui, args, repo, full="tree",
                 break
             count += 1
 
-@command('debug-rev-parse',
-    [('', 'default', '', _('ignored'))],
-    _('REV'))
-def revparse(ui, repo, *revs, **opts):
-    """parse given revisions"""
-    def revstr(rev):
-        if rev == 'HEAD':
-            rev = 'tip'
-        return revlog.hex(repo.lookup(rev))
-
-    for r in revs:
-        revrange = r.split(':', 1)
-        ui.write('%s\n' % revstr(revrange[0]))
-        if len(revrange) == 2:
-            ui.write('^%s\n' % revstr(revrange[1]))
-
 # git rev-list tries to order things by date, and has the ability to stop
 # at a given commit without walking the whole repo.  TODO add the stop
 # parameter