How to use Mercurial within PyCharm?


I am new to PyCharm and don't understand how to start a Django project and be able to commit it to my repository.

WHat is the best strategy?

1) To create an empty Repository on host (hg init), then open PyCharm and click on "Check out from Version Control. Then Clone the empty Repository from host to the local gost as directory? But then how do I add a Django project to the empty directory?

2) Open PyCharm, create a New Project, create a Django project. But then how to I start a new respository in order to add it to my host?

I am kind of confused how this should work.

Any help would be appreciated,


Comment actions Permalink

I have found a way to get the new Django project in the cloned repository. BUT I can't commit the new files, it doesnt see any changes.

Please help!

1) Create an empty repository on your mercurial host (hg init)

2) Open PyCharm - Click on "Checkout from Version Control" and select Mercurial

3) Enter the Repository URL e.g.

                  Parent Directory:  /home/user

                  Directory Name: ProjectX

    Click on CLone

4) Once succesfully cloned, click Yes to "Would you like to open the directory /home/user/ProjectX?"

5) Click on File -> New Project

    Project name: ProjectX

    Location: /home/user/ProjectX

    Project Type: Django

    --> OK

6) The directory '/home/user/ProjectX' is not empty. Would you like to create a project from existing sources instead?  -> NO

7) Application Name: ProjectX_App   --> OK

8) How would you like to open the project?

     Open in current window (tick)

     Add to currently opened projects (tick)

    --> Ok

9) The project at /home/user/ProjectX/.idea uses a non-standard layout and cannot be attached to this project. Would you like to open it in a new window?    (WHAT is THIS????)

    --> Yes

Now I have the Django folder structure in the cloned repository directory. But when I do commit it only recognizes some .idea files, not the actual Django folders and files.

Surely it can't be that complicated, am I missing something?

Many Thanks,

Comment actions Permalink

- Create a new Django project in an empty directory, as usual

- Select VCS | Import into Version Control | Create Mercurial Repository

Comment actions Permalink

Hi Dmitry,

Sorry I might now ask some weird questions, as I am new to Mercurial (coming from SVN background)

Well, but wouldn't do what you suggested just create a new respository locally on my machine, rather than on my server?

Correct me if I am wrong, but once the repository is locally created, I won't be able to push it to the server, if the project hasn't been initialized there first (hg init), no? Because there is no endpoint there defined yet.

Unless I could go on my server and clone my local repository in there?

Or alternatively zip the whole local repository and transfer it to my server and set it up there?

help  :-)


Please sign in to leave a comment.