Skip to content

Instantly share code, notes, and snippets.

@jpoehls
Created July 12, 2011 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpoehls/1077968 to your computer and use it in GitHub Desktop.
Save jpoehls/1077968 to your computer and use it in GitHub Desktop.
Hg-Export # PS function to export a diff file of uncommitted changes in the working repo
function Hg-Export([string]$Path) {
<#
.SYNOPSIS
Exports all uncommitted changes in the current HG repository
to a git formatted diff file at the specified path.
The resultant diff file can be re-imported into a repo using: hg import changes.diff
.EXAMPLE
Hg-Export changes.diff
# equivelant to: hg diff --git | Out-File changes.diff -Encoding ASCII; hg diff --stat
#>
hg diff --git | Out-File $Path -Encoding UTF8
hg diff --stat
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment