Mercurial Interview Questions And Answers

mercurial interview questions and answers   Top 11 Mercurial Interview Questions And Answers

1) What is Mercurial?

It is a distributed revision control tool for software developers. It is supported on Microsoft Windows and Unix-like systems, such as FreeBSD, macOS and Linux.

Matt Mackall originated Mercurial and has served as its lead developer until late 2016. Mercurial is released as free software under the terms of the GNU GPL v2.


2) What are the major design goals of Mercurial?

Following are the major design goals of Mercurial:

● High performance
● Scalability
● Decentralized
● Fully distributed collaborative development
● Robust handling
● Advanced branching
● Merging capabilities


3) Mercurial is implemented in which language?

It is mainly implemented using the Python programming language, but includes a binary diff implementation written in C.


4) What is being used by Mercurial to identify revisions?

Mercurial uses SHA-1 hashes to identify revisions.


5) What Mercurial uses for repository access?

For repository access via a network, Mercurial uses an HTTP-based protocol that seeks to reduce round-trip requests, new connections and data transferred.


6) In Mercurial, how we can clone a project and push changes?

Here is the code snippet:

$ hg clone abc
$ cd hello
$ (edit files)
$ hg add (new files)
$ hg commit -m 'My changes'
$ hg push


7) In Mercurial, how to create a project and commit?

Here is the code snippet:

$ hg init (project-directory)
$ cd (project-directory)
$ (add some files)
$ hg add
$ hg commit -m 'Initial commit'


8) What are the different benefits of Mercurial?

Following are the benefits:

● It is fast and powerful
● It is easy to learn
● And it just works


9) Why Mercurial is platform independent?

Mercurial was written with keeping platform independence in mind. Therefore most of Mercurial is written in Python, with a small part in portable C for performance reasons. As a result, binary releases are available on all major platforms.


10) How Mercurial is fast?

Its implementation and data structures are designed to be fast. We can generate diffs between revisions, or jump back in time within seconds. Therefore Mercurial is perfectly suitable for large projects such as OpenJDK (hg) or NetBeans (hg).


11) What kind of architecture does Mercurial have?

Mercurial is truly distributed, giving each developer a local copy of the entire development history. This way it works independent of network access or a central server. Committing, branching and merging are fast and cheap.