[PATCH] Subrepository support

Bill Barry after.fallout at gmail.com
Tue Feb 10 13:57:46 CST 2009


Alexander Solovyov wrote:
> diff --git a/mercurial/hg.py b/mercurial/hg.py
> --- a/mercurial/hg.py
> +++ b/mercurial/hg.py
> @@ -80,7 +80,7 @@
>      return path
>  
>  def clone(ui, source, dest=None, pull=False, rev=None, update=True,
> -          stream=False):
> +          stream=False, force=False):
>      """Make a copy of an existing repository.
>  
>      Create a copy of an existing repository in a new directory.  The
> @@ -112,6 +112,8 @@
>      update: update working directory after clone completes, if
>      destination is local repository (True means update to default rev,
>      anything else is treated as a revision)
> +
> +    force: force cloning even if destination already exists
>      """
>  
>      if isinstance(source, str):
> @@ -130,7 +132,7 @@
>      dest = localpath(dest)
>      source = localpath(source)
>  
> -    if os.path.exists(dest):
> +    if os.path.exists(dest) and not force:
>          raise util.Abort(_("destination '%s' already exists") % dest)
>  
>      class DirCleanup(object):
Isn't there a bunch of try... except... raise util.Abort(_("destination 
'%s' already exists"...?
This force option only looks to take care of one of the instances; 
wouldn't it be confusing as part of the api?


More information about the Mercurial-devel mailing list