Patchwork graphlog: do not bypass commands.log so that -fr works

login
register
mail settings
Submitter Yuya Nishihara
Date March 4, 2015, 3:23 p.m.
Message ID <6bd01a0f2eb263a08480.1425482601@mimosa>
Download mbox | patch
Permalink /patch/7902/
State Accepted
Headers show

Comments

Yuya Nishihara - March 4, 2015, 3:23 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1425473227 -32400
#      Wed Mar 04 21:47:07 2015 +0900
# Node ID 6bd01a0f2eb263a08480057040caaaaecfa2187c
# Parent  390410a6545d9088dc84392009f51500e3935a1c
graphlog: do not bypass commands.log so that -fr works

Since 8b4b9ee6001a, opts dict can be modified in commands.log() before calling
cmdutil.graphlog().
Matt Mackall - March 4, 2015, 8:02 p.m.
On Thu, 2015-03-05 at 00:23 +0900, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1425473227 -32400
> #      Wed Mar 04 21:47:07 2015 +0900
> # Node ID 6bd01a0f2eb263a08480057040caaaaecfa2187c
> # Parent  390410a6545d9088dc84392009f51500e3935a1c
> graphlog: do not bypass commands.log so that -fr works

Queued for default, thanks.
Ryan McElroy - March 5, 2015, 1:52 p.m.
On 3/4/2015 7:23 AM, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1425473227 -32400
> #      Wed Mar 04 21:47:07 2015 +0900
> # Node ID 6bd01a0f2eb263a08480057040caaaaecfa2187c
> # Parent  390410a6545d9088dc84392009f51500e3935a1c
> graphlog: do not bypass commands.log so that -fr works
>
> Since 8b4b9ee6001a, opts dict can be modified in commands.log() before calling
> cmdutil.graphlog().
>
> diff --git a/hgext/graphlog.py b/hgext/graphlog.py
> --- a/hgext/graphlog.py
> +++ b/hgext/graphlog.py
> @@ -54,4 +54,5 @@ def graphlog(ui, repo, *pats, **opts):
>       Nodes printed as an @ character are parents of the working
>       directory.
>       """
> -    return cmdutil.graphlog(ui, repo, *pats, **opts)
> +    opts['graph'] = True
> +    return commands.log(ui, repo, *pats, **opts)
> diff --git a/tests/test-glog.t b/tests/test-glog.t
> --- a/tests/test-glog.t
> +++ b/tests/test-glog.t
> @@ -2243,6 +2243,14 @@ Test --follow-first and backward --rev
>           ('symbol', 'rev')
>           ('symbol', '6'))))
>   
> +Test --follow with --rev of graphlog extension
> +
> +  $ hg --config extensions.graphlog= glog -qfr1
> +  o  1:216d4c92cf98
> +  |
> +  o  0:f8035bb17114
> +
> +
>   Test subdir
>   
>     $ hg up -q 3
>
Thanks for this fix Yuya!

Patch

diff --git a/hgext/graphlog.py b/hgext/graphlog.py
--- a/hgext/graphlog.py
+++ b/hgext/graphlog.py
@@ -54,4 +54,5 @@  def graphlog(ui, repo, *pats, **opts):
     Nodes printed as an @ character are parents of the working
     directory.
     """
-    return cmdutil.graphlog(ui, repo, *pats, **opts)
+    opts['graph'] = True
+    return commands.log(ui, repo, *pats, **opts)
diff --git a/tests/test-glog.t b/tests/test-glog.t
--- a/tests/test-glog.t
+++ b/tests/test-glog.t
@@ -2243,6 +2243,14 @@  Test --follow-first and backward --rev
         ('symbol', 'rev')
         ('symbol', '6'))))
 
+Test --follow with --rev of graphlog extension
+
+  $ hg --config extensions.graphlog= glog -qfr1
+  o  1:216d4c92cf98
+  |
+  o  0:f8035bb17114
+  
+
 Test subdir
 
   $ hg up -q 3