3

I've recently used Perfarce extension with mercurial on a linux system (Ubuntu 10.4 server) and did some modification to it's code to fit my needs.

Now, I would like to do the same on Windows 7x64 (where I installed TortoiseHg). I know tortoise Hg comes with some bundled extensions (perfarce included). I also know I can use a Mercurial.ini or hgrc file to enable extensions and specify the path to find them.

I suppose I could force a path to perfarce.py in my Mercurial.ini file (perfarce=path\to\extension) but since perfarce is already bundled with TortoiseHg installation, could I edit the bundled version? If so, where can I find it?

TIA

Alexandre

1 Answers1

2

I realize this is not an answer to you exact question, but wouldn't it be better to stick perfarce.py in an hg repo of its own and point to it in your Mercurial.ini?

That way you wouldn't have to worry about it ever again, not even when you will update TortoiseHg.

Edit

Ok, I fired up a Windows machine.

The perfarce extension is contained in TortoiseHg\library.zip\hgext, but it's a .pyo file.

Frankly, I don't know if replacing the .pyo with an actual .py file would work. It probably would, since the pyo is just what the Python interpreter outputs when invoked with the -O flag, but hey, I don't know much about Python.

I guess that trying is the only way to know for sure.

s.m.
  • 7,895
  • 2
  • 38
  • 46
  • Indeed, and you do have a point with the update part. (I'll leave the question 'unanswered' for a few more hours so I may get an answer to the original question (for curiosity), but the update part did the job for me), thx – Alexandre Huppe Jun 27 '11 at 17:10
  • So basically, every extensions are in a .zip file... that does explain why windows couldn't figure where perfarce* file was... (and I didn't think it was possible to use a library within a zip file. – Alexandre Huppe Jun 27 '11 at 20:38
  • Actually, every Python app compiled into an .exe makes use of that library.zip file: it contains Python's standard library plus, like in this case, other relevant stuff. – s.m. Jun 27 '11 at 20:43
  • But hey, do yourself a favor and don't use Windows to look for stuff, it's f*ckin' bad on so many levels it doesn't even deserve to be considered. Grab a copy of Total Commander. It can do all sorts of things when you got the hang of it (search in archives included). – s.m. Jun 27 '11 at 20:46
  • Thx for the tip. My day is fisnished but I'll look into it tomorrow (Total Commander and using a modified perface). BTW, if it doesn't work to put a .py in the library.zip... I'll compile my own perfarce.py into a .pyo before replacing the existing one. – Alexandre Huppe Jun 27 '11 at 20:53
  • Why not? Let me know if that works. I don't think I'll ever need to do that, but who knows. – s.m. Jun 27 '11 at 21:43
  • It does work. I guess it's not the best idea (since in Win7 I had to move the zip file in another directory before changing any file inside... seems windows doesn't like when we edit a zip file in a program file subdirectory...) But anyway, thx for the help... I might not directly use this trick, but I've learned about where Python apps store theirs libraries...and about Total Commander. – Alexandre Huppe Jun 28 '11 at 13:07