Wednesday 16 July 2014

Working with Mercurial

 

What is Mercurial

Mercurial is a Version Control System, just like Git with few changes, Mercurial is a Open Source Software, written in Python, unlike Git which is written in perl and C and was developed by Linus Torvalds. Although Git and Mercurial are almost same in there nature, different people have different preferences.
 According to Wikipedia, Mercurial is a cross-platform, distributed revision control tool for software developers. Mercurial's major design goals include high performance and scalability, decentralized, fully distributed collaborative development, robust handling of both plain text and binary files, and advanced branching and merging capabilities, while remaining conceptually simple.It includes an integrated web interface. Mercurial has also taken steps to ease the transition for SVN users.

Getting started with Mercurial

  • You can download and install Mercurial using
                      sudo apt-get install mercurial (for Ubuntu/debian)
                      yum install mercurial (for Fedora)

  • You have to create a .hgrc file in your home directory, as  "." in hgrc suggest that it is a hidden file, it is a configuration file and must be stored in home directory. Following is an example of .hgrc  file.

                       
[ui]
username = Rahul Mishra <rahulmishra@gmail.com>

[extensions]
purge =
strip =
color =
pager =
progress =
rebase =

[pager]
pager = LESS='FSRX' less
attend = tags, help, annotate, cat, diff, export, status,\
         outgoing, incoming, glog, log, grep




Using Mercirial

  • After setting up the .hgrc file we are ready to go, we can make a directory, mkdir dir_name then cd dir_name.
  •  Then we can create a file say vim Test.txt and we can write in it  and finally save and exit.
  • For intailizing Mercurial we have to give command hg init, just like git init, this command will initialize this directory as Mercurail repo.
  • hg init will add a hidden file .hg in this directory,also we have to add our file Test.txt to the empty repo by using command hg add Test.txt.
  • Next we have to commit the file, using hg commit <file_name>, this will open an editor, it is nano as default, you can also change with  select-editor command. Writing a good and precise and meaning full is very important, also give a space between the heading and the details.
  • A patch file is generated in the same way, now if we change our Test.txt and do a hg diff, we can see the difference made in the file. hg diff works only when you have not committed the changes, because once you have committed the changes the buffer are overridden and hg diff will not produce any output.
  • hg log gives the changes made in every commit and also gives the heading of the commit message. 
  •   hg status will give the currnt status of the files as Modified or  Added.     

Monday 7 July 2014

         The dgplug Summer Training is back '14


The #dgplug Summer Training is back again this year, started this week, it had more then 150 members in the initial days. This Summer training is however different from any other training, conducted on IRC(Internet Relay Chat) and surely one of a kind, the summer training aims mainly on python and FOSS(Free and Open Source Software) and Real-world project experience.



This training is conducted on freenode network and #dgplug channel, can be accessed by any IRC client, chatzilla and Xchat being the most famous ones. I personally use chatzilla as IRC Client. Typically the students are from Durgapur and Kolkata, however there are many students from different parts of India as well as abroad. The class usually starts at 18:30 IST and mainly conducted by Kushal Das (nick- kushal) CPython Developer and works in Redhat, Pune, India. Also others moderators are Sayan Choudhary(nick - sayan), Ratan Debnath (rtnpro), Chandan Kumar and Eijah.


Highlight of this summer training being interactions with the develpores, talks given by various Up stream Developers and online communcations atticates. This is my second year in this Training, last year i could not complete it because of Placement and studies issues, this year i have another problem, its the damn job training starting next month, although i will try my level best to continue my classes.

The only problem that the class have (according to me) is that the no. of students participating decrease day by day, and only 10-20 students complete there training fully, may be this is because not everybody can grasp to the new things they are learning also the pace the class goes with presents a little problem but the main problem being the students itself, they grows the tendency of not asking question and gradually the lose there interest too, else everything related with this training is just awesome.