Patchwork [stable] share: fix unshare calling wrong repo.__init__() method

login
register
mail settings
Submitter Brodie Rao
Date Nov. 16, 2013, 10:30 p.m.
Message ID <65d89935d977761c2e51.1384641038@hit-nxdomain.opendns.com>
Download mbox | patch
Permalink /patch/2995/
State Accepted
Commit cbcd85fa75c07670bc9263b8610ac3b43acac538
Headers show

Comments

Brodie Rao - Nov. 16, 2013, 10:30 p.m.
# HG changeset patch
# User Brodie Rao <brodie@sf.io>
# Date 1384641034 18000
#      Sat Nov 16 17:30:34 2013 -0500
# Branch stable
# Node ID 65d89935d977761c2e51f13310f83d13d1195532
# Parent  ba6486076429e5c20d910b8a5d4f8acf1e9dc1b1
share: fix unshare calling wrong repo.__init__() method

When running the unshare command, if there's other code that tries to use
the repo after the command is finished, it'll end up with a ui object for
repo.unfiltered(). This change fixes an erroneous call to repo.__init__()
that could be on the repoview proxy class--now it's always done on the
unfiltered repo.
Augie Fackler - Nov. 17, 2013, 10:40 p.m.
On Sat, Nov 16, 2013 at 05:30:38PM -0500, Brodie Rao wrote:
> # HG changeset patch
> # User Brodie Rao <brodie@sf.io>
> # Date 1384641034 18000
> #      Sat Nov 16 17:30:34 2013 -0500
> # Branch stable
> # Node ID 65d89935d977761c2e51f13310f83d13d1195532
> # Parent  ba6486076429e5c20d910b8a5d4f8acf1e9dc1b1
> share: fix unshare calling wrong repo.__init__() method

queued for stable, thanks

>
> When running the unshare command, if there's other code that tries to use
> the repo after the command is finished, it'll end up with a ui object for
> repo.unfiltered(). This change fixes an erroneous call to repo.__init__()
> that could be on the repoview proxy class--now it's always done on the
> unfiltered repo.
>
> diff --git a/hgext/share.py b/hgext/share.py
> --- a/hgext/share.py
> +++ b/hgext/share.py
> @@ -58,7 +58,7 @@ def unshare(ui, repo):
>          lock and lock.release()
>
>      # update store, spath, sopener and sjoin of repo
> -    repo.__init__(repo.baseui, repo.root)
> +    repo.unfiltered().__init__(repo.baseui, repo.root)
>
>  cmdtable = {
>      "share":
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/share.py b/hgext/share.py
--- a/hgext/share.py
+++ b/hgext/share.py
@@ -58,7 +58,7 @@  def unshare(ui, repo):
         lock and lock.release()
 
     # update store, spath, sopener and sjoin of repo
-    repo.__init__(repo.baseui, repo.root)
+    repo.unfiltered().__init__(repo.baseui, repo.root)
 
 cmdtable = {
     "share":