views:

17

answers:

1

I am trying to execute hgtk log command for a particular file. But you cannot do it until you are in the repository directory.

something like this...

process.initwithpath("cmd.exe"); 
args = ["CD","c:\\MY_REPO"];
process.run(true,args,args.length);
process.initwithpath("hg.exe"); 
args= ["hgtk","my_file.txt"]; 
process.run(true,args,args.length);

But the problem is second process will not keep track of first one....

Any suggestions will be highly appreciated....

+1  A: 

See the --repository command line option (short from is -R). It will change the current working directory of hgtk before executing log, annotate, etc. If you provide a filename on the command line, then you should beware that they are understood relative to the argument of -R. So this works:

hgtk -R ~/src/mercurial log README

because the README file is found relative to ~/src/mercurial. This also works

hgtk -R ~/src/mercurial log ~/src/mercurial/README

since we give the full path to the README file. In this sense it works like Mercurial's --cwd option. Mercurial also has a -R option, but this does not change the current working directory.

Martin Geisler
that works...that was really helpful and give a good insight for how to use hgtk command with different options...Thanks a zillion !!!
Nitesh
Nitesh: You're welcome :-)
Martin Geisler