import hgnested
sour = "C:\Users\ADMIN\Documents\mercurial\hgserver"
desti = "D:\Work"
hgnested.nclone(source = sour, dest = desti)
Here I am trying to clone a nested repository "hgserver" which has 5 more repositories in it. But I am getting and error,
TypeError: nclone() takes at least 2 arguments (2 given)
I then looked at the source code of hgnested package of python at this link and found that the nclone() method takes an argument "ui" to which I don't understand what to pass.
def nclone(ui, source, dest=None, **opts):
Can anybody help me out.
PS:Due to my low reputation I am unable to add relevant tags for this question. Ex: hgnested, nclone
Hgnested is not what you want if you wanted to clone a file from and to your local drive. As I read their "documentation", a few lines of nothing, it's just a small extension to Mercurial. If all you wanted to do is to copy a directory, you should do this:
import shutil
shutil.copytree(sour, desti) # copy dirs
# use shutil.copy() to copy files
And to answer your original question, ui is the user interface class from Mercurial.
Here, ui and repo are the user interface and repository arguments passed into an extension function as standard (see WritingExtensions for more details). If you are not calling the Mercurial command functions from an extension, you will need to create suitable ui and repo objects yourself. The ui object can be instantiated from the ui class in mercurial.ui; the repo object can either be a localrepository, a httprepository, an sshrepository or a statichttprepository (each defined in their own modules), though it will most often be a localrepository.