librelist archives

« back to archive

debug mode with TortoiseHg install

debug mode with TortoiseHg install

From:
Benoît Allard
Date:
2010-07-28 @ 08:59
Hi there,

I'm wondering if someone is able to run "hg --web --debug" from a 
Tortoise Install (either with the contrib script from Daniel Newton or 
by manually copying the library in a path where he can find them).

My problem is as follow:

C:\repository>hg review --web --debug
starting web server
Could not find flask-lesscss, not auto-rendering .less files!
  * Running on http://127.0.0.1:8080/
  * Restarting with reloader...
hg: unknown command 'hg'
Mercurial Distributed SCM

basic commands:

  add        add the specified files on the next commit
  annotate   show changeset information by line for each file
  clone      make a copy of an existing repository
  commit     commit the specified files or all outstanding changes
  diff       diff repository (or selected files)
  export     dump the header and diffs for one or more changesets
  fclone     make a clone of an existing forest of repositories
  forget     forget the specified files on the next commit
  fpull      pull changes from the specified forest
  fpush      push changes to the specified forest.
  fstatus    show changed files in the working forest
  fupdate    update working forest
  init       create a new repository in the given directory
  log        show revision history of entire repository or files
  merge      merge working directory with another revision
  pull       pull changes from the specified source
  push       push changes to the specified destination
  qdiff      diff of the current patch and subsequent modifications
  qnew       create a new patch
  qpop       pop the current patch off the stack
  qpush      push the next patch onto the stack
  qrefresh   update the current patch
  remove     remove the specified files on the next commit
  serve      start stand-alone webserver
  status     show changed files in the working directory
  summary    summarize working directory state
  update     update working directory (or switch revisions)

use "hg help" for the full list of commands or "hg -v" for details

C:\repository>

Process monitor clearly shows that hg is being run with as parameter "hg 
review --web --debug" which obviously does not works.

Anyone, hints ?

Regards,
Benoit

Re: [hg.review] debug mode with TortoiseHg install

From:
Daniel Newton
Date:
2010-07-28 @ 11:23
I have been spelunking around and I think the problem stems from differences
in the way a normal python interpreter and a py2exe prog (like tortoisehg)
represent sys.executable and sys.argv.

In the werkzeug/serving.py there is a function restart_with_reloader (used
in debug mode):

args = [sys.executable] + sys.argv
...
exit_code = subprocess.call(args, env=new_environ)

args is going to be something like ['/path/to/python.exe',
'the_hg_script.py', 'review', '--web', '--debug'] when using the normal
python interpreter and something like ['/path/to/tortoisehg/hg.exe',
'hg', 'review',
'--web', '--debug'] when using tortoisehg

modding the line in restart_with_reloader to "args = [sys.executable] +
sys.argv[1:]" makes tortoisehg work but is not a general solution
(obviously).

Something to chew on...

Cheers

Dan

2010/7/28 Benoît Allard <benoit@aeteurope.nl>

> Hi there,
>
> I'm wondering if someone is able to run "hg --web --debug" from a Tortoise
> Install (either with the contrib script from Daniel Newton or by manually
> copying the library in a path where he can find them).
>
> My problem is as follow:
>
> C:\repository>hg review --web --debug
> starting web server
> Could not find flask-lesscss, not auto-rendering .less files!
>  * Running on http://127.0.0.1:8080/
>  * Restarting with reloader...
> hg: unknown command 'hg'
> Mercurial Distributed SCM
>
> basic commands:
>
>  add        add the specified files on the next commit
>  annotate   show changeset information by line for each file
>  clone      make a copy of an existing repository
>  commit     commit the specified files or all outstanding changes
>  diff       diff repository (or selected files)
>  export     dump the header and diffs for one or more changesets
>  fclone     make a clone of an existing forest of repositories
>  forget     forget the specified files on the next commit
>  fpull      pull changes from the specified forest
>  fpush      push changes to the specified forest.
>  fstatus    show changed files in the working forest
>  fupdate    update working forest
>  init       create a new repository in the given directory
>  log        show revision history of entire repository or files
>  merge      merge working directory with another revision
>  pull       pull changes from the specified source
>  push       push changes to the specified destination
>  qdiff      diff of the current patch and subsequent modifications
>  qnew       create a new patch
>  qpop       pop the current patch off the stack
>  qpush      push the next patch onto the stack
>  qrefresh   update the current patch
>  remove     remove the specified files on the next commit
>  serve      start stand-alone webserver
>  status     show changed files in the working directory
>  summary    summarize working directory state
>  update     update working directory (or switch revisions)
>
> use "hg help" for the full list of commands or "hg -v" for details
>
> C:\repository>
>
> Process monitor clearly shows that hg is being run with as parameter "hg
> review --web --debug" which obviously does not works.
>
> Anyone, hints ?
>
> Regards,
> Benoit
>

Re: [hg.review] debug mode with TortoiseHg install

From:
Benoît Allard
Date:
2010-07-28 @ 12:53
Daniel Newton wrote:
> I have been spelunking around and I think the problem stems from 
> differences in the way a normal python interpreter and a py2exe prog 
> (like tortoisehg) represent sys.executable and sys.argv.
> 
> In the werkzeug/serving.py there is a function restart_with_reloader 
> (used in debug mode):
> 
> args = [sys.executable] + sys.argv
> ...
> exit_code = subprocess.call(args, env=new_environ)
> 
> args is going to be something like ['/path/to/python.exe', 
> 'the_hg_script.py', 'review', '--web', '--debug'] when using the normal 
> python interpreter and something like ['/path/to/tortoisehg/hg.exe', 
> 'hg', 'review', '--web', '--debug'] when using tortoisehg
> 
> modding the line in restart_with_reloader to "args = [sys.executable] + 
> sys.argv[1:]" makes tortoisehg work but is not a general solution 
> (obviously).

We can decide on which one to use this with help from the "sys.frozen" 
status set by py2exe !

Should we open a bug at werkzeug for this ?

> 
> Something to chew on...
> 

Thanks a lot !

Regards
Benoit

Re: [hg.review] debug mode with TortoiseHg install

From:
Daniel Newton
Date:
2010-07-28 @ 22:57
2010/7/29 Benoît Allard <benoit@aeteurope.nl>

>
> Daniel Newton wrote:
>
>> I have been spelunking around and I think the problem stems from
>> differences in the way a normal python interpreter and a py2exe prog (like
>> tortoisehg) represent sys.executable and sys.argv.
>>
>> In the werkzeug/serving.py there is a function restart_with_reloader (used
>> in debug mode):
>>
>> args = [sys.executable] + sys.argv
>> ...
>> exit_code = subprocess.call(args, env=new_environ)
>>
>> args is going to be something like ['/path/to/python.exe',
>> 'the_hg_script.py', 'review', '--web', '--debug'] when using the normal
>> python interpreter and something like ['/path/to/tortoisehg/hg.exe', 'hg',
>> 'review', '--web', '--debug'] when using tortoisehg
>>
>> modding the line in restart_with_reloader to "args = [sys.executable] +
>> sys.argv[1:]" makes tortoisehg work but is not a general solution
>> (obviously).
>>
>
> We can decide on which one to use this with help from the "sys.frozen"
> status set by py2exe !
>
> Should we open a bug at werkzeug for this ?
>


good idea.. I have logged http://dev.pocoo.org/projects/werkzeug/ticket/475