[PATCH 1 of 4] largefiles: don't pop largefile specific arguments to the add command

Martin von Zweigbergk martinvonz at google.com
Thu Jan 15 22:36:56 CST 2015


On Thu Jan 15 2015 at 7:40:19 PM Matt Harbison <mharbison72 at gmail.com>
wrote:

> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1420068272 18000
> #      Wed Dec 31 18:24:32 2014 -0500
> # Node ID 6c893ee9c85def62e2f19de9f4a2b5288a12a5fd
> # Parent  049a9e3a078d7c988cb12ed456aad6ec2779ea69
> largefiles: don't pop largefile specific arguments to the add command
>
> The arguments will need to stay present when making add work with subrepos.
>
> diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py
> --- a/hgext/largefiles/overrides.py
> +++ b/hgext/largefiles/overrides.py
> @@ -90,9 +90,9 @@
>              scmutil.matchandpats)
>
>  def addlargefiles(ui, repo, isaddremove, matcher, **opts):
> -    large = opts.pop('large', None)
> +    large = opts.get('large')
>      lfsize = lfutil.getminsize(
> -        ui, lfutil.islfilesrepo(repo), opts.pop('lfsize', None))
> +        ui, lfutil.islfilesrepo(repo), opts.get('lfsize'))
>
>      lfmatcher = None
>      if lfutil.islfilesrepo(repo):
> @@ -247,7 +247,7 @@
>  # matcher which matches only the normal files and runs the original
>  # version of add.
>  def overrideadd(orig, ui, repo, *pats, **opts):
> -    normal = opts.pop('normal')
> +    normal = opts.get('normal')
>

Nit: unlike pop(), get() doesn't raise KeyError. Use opts['normal'] unless
that's a wanted change.


>      if normal:
>          if opts.get('large'):
>              raise util.Abort(_('--normal cannot be used with --large'))
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20150116/ac40ce99/attachment.html>


More information about the Mercurial-devel mailing list