Skip to content

Instantly share code, notes, and snippets.

@akash0x53
Created December 21, 2014 06:18
Show Gist options
  • Select an option

  • Save akash0x53/c24492f905c1b7a9bcb0 to your computer and use it in GitHub Desktop.

Select an option

Save akash0x53/c24492f905c1b7a9bcb0 to your computer and use it in GitHub Desktop.
generate hg diff
#Generate Mercurial diff and save in `diffs' subdir.
generate_diff(){
diff_dir="diffs"
mkdir -p ${diff_dir}
branch=`hg branch`
now=`date +"%F_%T"`
file_path="${PWD}/${diff_dir}/${branch}_${now}.diff"
`hg diff > ${file_path}`
[ $? -eq 0 ] && echo "created diff ${file_path}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment