Using Mercurial Hg to Pull and Commit

On my latest project I need to use Mercurial Hg as source control tool.
I'm on windows so I use Tortoise Hg (who also prvide svn and cvs ui tools)

One big difference thus far is committing to and updating from the repo is a 2 step process for Mercurial.

When getting changes from the central repo, you must Pull the changes (changeset) but then also merge and commit then to your local (just pulling is not enough). You must commit your own local changes first before you can commit the pulled changes. Tortoise hg synch menu has an option to just pull all or view a list of pulls and decide what to accept.
From the docs:

  1. Pull changes from the group repository into your repository, TortoiseHg ‣ Repository Browser or hgtk log, choose the path to the group repository in the syncbar and then Pull.
  2. If some changesets were pulled, merge those changes with your local changes and then commit the merge into your local repository. From the changelog viewer (TortoiseHg ‣ Repository Browser or hgtk log) open the context menu over the changeset which you want to merge and select merge with. Finally, in the merge dialog, press Merge and then Commit.

You commit and can then Push at a later time. Push will push all commits to date.
From the docs

When you’re ready to publish your changes, you
  1. Commit your changes to your local repository (see above).
  2. Pull changes from the group repository into your repository, TortoiseHg ‣ Repository Browser or hgtk log, choose the path to the group repository in the syncbar and then Pull.
  3. If some changesets were pulled, merge those changes with your local changes and then commit the merge into your local repository. From the changelog viewer (TortoiseHg ‣ Repository Browser or hgtk log) open the context menu over the changeset which you want to merge and select merge with. Finally, in the merge dialog, press Merge and then Commit.
  4. Ensure your merged work still builds and passes your extensive test suite.
  5. Push your changes to the group repository, TortoiseHg ‣ Repository Browser or hgtk log, choose the path to group repository and then Push.

Comments

Popular posts from this blog

deep dive into Material UI TextField built by mui

angular js protractor e2e cheatsheet

react-router v6.4+ loaders, actions, forms and more