Patchwork [1,of,2,default] record: fix the -u option (issue 3857)

login
register
mail settings
Submitter Sandeep.C.R
Date Nov. 29, 2013, 2:41 a.m.
Message ID <be674fae4c5200453f9c.1385692902@localhost.localdomain>
Download mbox | patch
Permalink /patch/3189/
State Superseded
Headers show

Comments

Sandeep.C.R - Nov. 29, 2013, 2:41 a.m.
# HG changeset patch
# User Sandeep.C.R <sandeepcr2@gmail.com>
# Date 1385566008 -19800
# Node ID be674fae4c5200453f9ce5139333239caf70968e
# Parent  af12f58e2aa081ce512cc4a8b87dd354a45123e5
record: fix the -u option (issue 3857)
Sean Farley - Nov. 29, 2013, 7:13 p.m.
sandeepcr2@gmail.com writes:

> # HG changeset patch
> # User Sandeep.C.R <sandeepcr2@gmail.com>
> # Date 1385566008 -19800
> # Node ID be674fae4c5200453f9ce5139333239caf70968e
> # Parent  af12f58e2aa081ce512cc4a8b87dd354a45123e5
> record: fix the -u option (issue 3857)
>
> diff -r af12f58e2aa0 -r be674fae4c52 hgext/record.py
> --- a/hgext/record.py	Mon Nov 25 16:15:44 2013 -0600
> +++ b/hgext/record.py	Wed Nov 27 20:56:48 2013 +0530
> @@ -502,7 +502,7 @@
>                           cmdsuggest)
>  
>      # make sure username is set before going interactive
> -    ui.username()
> +    opts.get('user') or ui.username()

So, this worries me a bit since we're not saving the username for use
later. Will this actually work?

>  
>      def recordfunc(ui, repo, message, match, opts):
>          """This is generic record driver.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Augie Fackler - Nov. 29, 2013, 11:50 p.m.
On Fri, Nov 29, 2013 at 01:13:31PM -0600, Sean Farley wrote:
>
> sandeepcr2@gmail.com writes:
>
> > # HG changeset patch
> > # User Sandeep.C.R <sandeepcr2@gmail.com>
> > # Date 1385566008 -19800
> > # Node ID be674fae4c5200453f9ce5139333239caf70968e
> > # Parent  af12f58e2aa081ce512cc4a8b87dd354a45123e5
> > record: fix the -u option (issue 3857)
> >
> > diff -r af12f58e2aa0 -r be674fae4c52 hgext/record.py
> > --- a/hgext/record.py	Mon Nov 25 16:15:44 2013 -0600
> > +++ b/hgext/record.py	Wed Nov 27 20:56:48 2013 +0530
> > @@ -502,7 +502,7 @@
> >                           cmdsuggest)
> >
> >      # make sure username is set before going interactive
> > -    ui.username()
> > +    opts.get('user') or ui.username()
>
> So, this worries me a bit since we're not saving the username for use
> later. Will this actually work?

+1

>
> >
> >      def recordfunc(ui, repo, message, match, opts):
> >          """This is generic record driver.
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel@selenic.com
> > http://selenic.com/mailman/listinfo/mercurial-devel
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff -r af12f58e2aa0 -r be674fae4c52 hgext/record.py
--- a/hgext/record.py	Mon Nov 25 16:15:44 2013 -0600
+++ b/hgext/record.py	Wed Nov 27 20:56:48 2013 +0530
@@ -502,7 +502,7 @@ 
                          cmdsuggest)
 
     # make sure username is set before going interactive
-    ui.username()
+    opts.get('user') or ui.username()
 
     def recordfunc(ui, repo, message, match, opts):
         """This is generic record driver.