Posts

Basic commands of Mercurial

These commands are very much to the subversion. 1. Creating a repository (hg init)   Create a mercurial repository in an empty directory by using the init command: [root@localhost ~]# mkdir Test [root@localhost ~]# cd Test [root@localhost Test]# hg init [root@localhost Test]# ls -lar total 12 drwxr-xr-x. 3 root root 4096 May 21 06:42 .hg dr-xr-x---. 36 root root 4096 May 21 06:40 .. drwxr-xr-x. 3 root root 4096 May 21 06:42 . Now there is an empty repository created, locally in your directory. The repository contains both a working copy, and the repository data (the history information). 2. Adding a file (hg add) Schedule a file for addition [root@localhost Test]# echo "Testing1" >>test.txt [root@localhost Test]# ls -lar total 16 -rw-r--r--. 1 root root 9 May 21 06:47 test.txt drwxr-xr-x. 3 root root 4096 May 21 06:42 .hg dr-xr-x---. 36 root root 4096 May 21 06:40 .. drwxr-xr-x. 3 root root ...

Installation and configuration of Mercurial

Image
Installation Windows : The best version of Mercurial for Windows is TortoiseHg, which can be found at http://tortoisehg.bitbucket.org/ . This package has no external dependencies. It “just works.” It provides both command-line and graphical user interfaces. After installation, you will have a right-click menu in Windows Explorer that gives you access to the graphical tools. After logging out and in again, you will also have a hg and a thg program available in a Command Prompt. You can use the thg program to start the graphical TortoiseHg tools. Command-line : (figure 1) GUI : (figure2) Linux : You can install Mercurial on Linux using package manager - yum install *mercurial* but installing it from package manager not assure you the latest version of mercurial. So, You can install the latest version(2.6) from source http://mercurial.selenic.com/release , unpack it and run make install to install it. If you get any issue...

What is Mercurial ?

Mercurial is a fast, lightweight Source Control Management system designed for efficient handling of very large distributed projects. It is mainly implemented using the Python programming language. It is supported on Windows and Unix-like systems, such as Mac OS X and Linux. All of Mercurial's operations are invoked as arguments to its driver program hg, a reference to the chemical symbol of the element mercury. 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.  How you can benefit from Mercurial It is fast and powerful, It efficiently handles projects of any size and kind. Every clone contains the whole project history, so most actions are local, fast and convenient. Mercurial supports a multitude of workflows and you can easily enhance its fun...

How to read certificates using CertificateFactory class

In my previous blog , I have explained how can you create self signed certificate using bouncy castle API and how to import it into keystore. This tutorial will explain how to read existing certificate file using java.security.cert.CertificateFactory class. import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.security.KeyStore; import java.security.PublicKey; import java.security.cert.Certificate; import java.security.cert.CertificateFactory; /**  * Reads the certificate and import into Java keystore.  *  * @author abdul  *  */ public class ReadCertificateFile {      /**      * @param args      * @throws Exception      */     public static void main(String[] args) throws Exception {         ReadCertificateFile readCertificateFile = new ReadCertificateFile();   ...

Eclipse - Tips & Tricks

This article is for those who use Eclipse. Keyboards shortcuts are very important for comfortable and quick editing. Here are the list of most important shortcuts in Eclipse : For a full list of shortcuts, you can also check by pressing Ctrl+Shift+L. Ctrl +3 Focus into the Quick Access search box which allows you to execute any Eclipse command. Ctrl+SHIFT+T Search dialog for Java Type, Start typing the name and the list gets smaller. Try typing the capital letters of the class only (e.g. type "NPE" to find "NullPointerException") Ctrl+SHIFT+R Search dialog for resources, e.g. Xml files, text files, or files of any other type. Ctrl+E Open Editor Drop down, Presents a popup window listing currently opened files. Ctrl+O Quick Outline, Show all methods of the current class, Press Ctrl+O a second time to include inherited methods. Ctrl+SHIFT+space Context Information Ctrl+Shift+O Organize Imports, Adjusts the imports ...

Hibernate Configuration

To inform Hibernate from where to find mapping information of Java classes to database tables or configuration setting related to database, All such information is usually supplied by Hibernate Configuration Object. It is managed by an instance of org.hibernate.cfg.Configuration. An instance of org.hibernate.cfg.Configuration represents an entire set of mappings of an application’s Java types to an SQL database. The mappings are compiled from various XML mapping files or from Java 5 Annotations. Hibernate provides following types of configurations hibernate.cfg.xml – A standard XML file which contains hibernate configuration and which resides in root of application’s CLASSPATH  hibernate.properties – A Java compliant property file which holds key value pair for different hibernate configuration strings.  Programmatic configuration – This is the manual approach. The configuration can be defined in Java class.  1. hibernate.cfg.xml : The hibernate.cfg.xml file...