How to remove all .orig files created by Mercurial
Answer:
In your working directory, execute the command below to remove all .orig files:
# rm **/*.orig
Short and sweet.
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to remove all .orig files created by Mercurial
Answer:
In your working directory, execute the command below to remove all .orig files:
# rm **/*.orig
Short and sweet.
Adding the missing ignore function to Mercurial
Answer:
The following script add the ignore function to the Mercurial
#!/usr/bin/env python
"""Ignore pathnames and patterns"""
import os
def ignore(ui, repo, *pathnames):
"""Ignore the given pathnames and patterns."""
outf = open(os.path.join(repo.root, ".hgignore"), "a")
for p in pathnames:
outf.write(p + "\n")
outf.close()
return
cmdtable = {
'ignore': (ignore, [], "hg ignore pathname [pathname]"),
}
Save the script as ignore.py (e.g. ~/hg/ignore.py), and add the following line in your own ~/.hgrc
[extensions]
ignore = ~/hg/ignore.py
Reference: http://dmoonc.com/blog/?p=266
Create a new branch in Git
Answer:
In Git, to create a new branch, enter the command below:
# git branch test
To switch to the branch just created, type:
# git checkout test
Switched to branch "test"
Print SVN log in chronical order
Answer:
To print the svn log in chronical order (according to the time they occured)
# svn log -r1:HEAD
Replace the -r1 with the revision you needed.
Merge changes from trunk into branch in SVN
Answer:
Assume you have created a branch in SVN, which is at revision 125. Now the trunk's head revision is increased to 150, and you want to merge the changes happened in trunk and port to branch also.
In your branch's working folder, execute:
# svn merge -r 125:HEAD_REVISION http://example.com/svn/repos/demo/trunk .
That's it.