[PATCH hglib] client: add purge command
Idan Kamara
idankk86 at gmail.com
Tue Oct 2 15:12:26 CDT 2012
On Tue, Oct 2, 2012 at 8:24 PM, Victor Garcia <bravejolie at gmail.com> wrote:
>
> # HG changeset patch
> # User victor
> # Date 1349202168 -7200
> # Node ID 6172601e7f7b3d7c8c3539e2758cfba8ab0784a4
> # Parent e5d3b0aa48e6ab79531204f61e25ee335b306df3
> client: add purge command
Thanks for sending this here.
>
> Adding the purge command to hglib. Since it's an extension, appending
> '--config extensions.hgext.purge=' to enable it
Like I said earlier once an extension is enabled, it lingers in
the cmdserver
process forever (since they're managed in a global variable). I guess that's
harmless here.
>
> diff -r e5d3b0aa48e6 -r 6172601e7f7b hglib/client.py
> --- a/hglib/client.py Tue Jan 17 17:15:47 2012 -0600
> +++ b/hglib/client.py Tue Oct 02 20:22:48 2012 +0200
> @@ -1511,6 +1511,29 @@
> counters = out.rstrip().split(', ')
> return tuple(int(s.split(' ', 1)[0]) for s in counters)
>
> + def purge(self, files, all=False, include=None, exclude=None):
By the looks of hg purge -h it looks like the signature you gave here
doesn't match:
- purge can be invoked without arguments
- files should be called dirs (with a default)
- -a, -p and -0 are missing
> + """
> + Purge the files specified by parameters. It physically removes
> the non-tracked files from the file system.
> +
> + Return True on success
> +
> + all - revert all changes when no arguments given
purge -h says "--all purge ignored files too"?
> + include - include names matching the given patterns
> + exclude - exclude names matching the given patterns
> +
> + """
> + if not isinstance(files, list):
> + files = [files]
> +
> + args = cmdbuilder('purge',
> + all=all, I=include, X=exclude, *files)
> + args.extend(['--config', 'extensions.hgext.purge='])
> +
> + eh = util.reterrorhandler(args)
> + self.rawcommand(args, eh=eh)
> +
> + return bool(eh)
> +
> @property
> def version(self):
> """
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20121002/fd1f86da/attachment.html>
More information about the Mercurial-devel
mailing list