Patchwork [3,of,3] highlight: remove temporary hack to overwrite repo.getcwd

login
register
mail settings
Submitter Yuya Nishihara
Date Sept. 22, 2015, 9:27 a.m.
Message ID <185e9f85a79191f92139.1442914039@mimosa>
Download mbox | patch
Permalink /patch/10576/
State Accepted
Headers show

Comments

Yuya Nishihara - Sept. 22, 2015, 9:27 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1442747607 -32400
#      Sun Sep 20 20:13:27 2015 +0900
# Node ID 185e9f85a79191f92139552280eaca4227aca8c1
# Parent  1fd00d367894b351a5f6110eb7ed5b67d233846c
highlight: remove temporary hack to overwrite repo.getcwd

Now hgweb does it globally.
Anton Shestakov - Sept. 22, 2015, 3:10 p.m.
22.09.2015, 17:32, "Yuya Nishihara" <yuya@tcha.org>:
>  # HG changeset patch
>  # User Yuya Nishihara <yuya@tcha.org>
>  # Date 1442747607 -32400
>  # Sun Sep 20 20:13:27 2015 +0900
>  # Node ID 185e9f85a79191f92139552280eaca4227aca8c1
>  # Parent 1fd00d367894b351a5f6110eb7ed5b67d233846c
>  highlight: remove temporary hack to overwrite repo.getcwd

This series LGTM, for what it's worth.

Thanks for looking into my temporary hack :)
Augie Fackler - Sept. 22, 2015, 6:58 p.m.
On Tue, Sep 22, 2015 at 11:10:48PM +0800, Anton Shestakov wrote:
> 22.09.2015, 17:32, "Yuya Nishihara" <yuya@tcha.org>:
> >  # HG changeset patch
> >  # User Yuya Nishihara <yuya@tcha.org>
> >  # Date 1442747607 -32400
> >  # Sun Sep 20 20:13:27 2015 +0900
> >  # Node ID 185e9f85a79191f92139552280eaca4227aca8c1
> >  # Parent 1fd00d367894b351a5f6110eb7ed5b67d233846c
> >  highlight: remove temporary hack to overwrite repo.getcwd
>
> This series LGTM, for what it's worth.

Worth quite a bit, and I agree. Series queued, many thanks to both of you!

>
> Thanks for looking into my temporary hack :)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> https://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/highlight/__init__.py b/hgext/highlight/__init__.py
--- a/hgext/highlight/__init__.py
+++ b/hgext/highlight/__init__.py
@@ -33,10 +33,6 @@  def checkfctx(fctx, expr):
     ctx = fctx.changectx()
     tree = fileset.parse(expr)
     mctx = fileset.matchctx(ctx, subset=[fctx.path()], status=None)
-    repo = ctx.repo()
-    # To allow matching file names in the fileset in hgweb directory mode.
-    # See issue4568.
-    object.__setattr__(repo, 'getcwd', lambda: repo.root)
     return fctx.path() in fileset.getset(mctx, tree)
 
 def filerevision_highlight(orig, web, req, tmpl, fctx):