Skip to content

Instantly share code, notes, and snippets.

@fernandoPalaciosGit
Last active November 16, 2017 08:05
Show Gist options
  • Select an option

  • Save fernandoPalaciosGit/677828eca375e69dd8f8 to your computer and use it in GitHub Desktop.

Select an option

Save fernandoPalaciosGit/677828eca375e69dd8f8 to your computer and use it in GitHub Desktop.
Mercurial commands

export last | specific commit to patch

$hg export -o [absulute\path\mypatch.patch] -r [IDChangeset1:IDChangeset2:IDChangeset3 | tip]

export working space changes (not commited) to patch

$hg diff -r tip > [absulute\path\mypatch.patch]

apply/import patch to HEAD [to Working directory]

$hg import [absulute\path\mypatch.patch] --no-commit

mostrar los commit de un solo ticket (las asociados a ese ticket)

$hg log -k PGRTED-2008

mostrar los ultiomos 10 cambios de un usuario determinado

$hg log -k [user_name] -l 10

mostrar cambios en ficheros de un usuaruio

$hg log -k [user_name] -l [num] -v | grep

mostrar lar ultimas 5 revisiones

$hg log -v -l 5 -r [IDChangeset | tip]

difference between two changesets of one specific file

$hg diff -r <changeset_num>:<chenageset_num> <full_path_file>

$hg diff -r 1:24602 <full_path_file>

log / commit changes from one person of one specific file

$hg log -k "fernando palacios" -k "accommodationdetails" -l 10 -v

remove from staged/indexed sstatus

$hg forget <relative_path_name>

exclude files from commit (unstage)

$hg commit -X [path/to/exclude/file] -m "comment"

update working directory

activate plugin merccurual : purge =

$hg update [-C limpiar cambios no comitados] [-r revision]

revert proyect to revision (--reset hard) (cannot be push force on remote)

  • activate plugin merccurual : mq =
  • also remove pointed revision, should strip to one up revision

$hg strip --rev [revision] [--keep (keep changesets in workingdirectory)]

revert proyect to last revision (--reset hardone level, last merge or commit) (cannot be push force on remote)

$hg rollback

multiple heads

$hg merge [--rev changeset]

$hg update --clean -r tip

$hg commit -m "merge"

update working directory to changeset into ID revision

$hg revert --rev [revision] [file]

diff file to revision

$hg diff --rev [revision] [file]

concatenate changeset OR squash commits

squash

shelve : save/restore working-directory into shelve status

$hg shelve .

$hg unshelve .

mercurial staus

  • M = modified
  • A = added
  • R = removed
  • C = clean
  • ! = missing (deleted by non-hg command, but still tracked)
  • ? = not tracked
  • I = ignored

difference between remotes and local

$hg [in|out] [-p] [remote-url/branch-name]

Built-in Web Server

$hg serve -d -n [project-name]

http://localhost:8000

list file changed from a changeset

$hg lg -l[NUM] -k "[NAME]"

$hg status --change [REV]

$hg unbundle .hg/strip-backup/[id-backup].hg

remove local branch

hg pull
hg update TLGBSiteConfig
hg commit --close-branch -m "Close branch TLGBSiteConfig"
hg update default
hg merge TLGBSiteConfig
hg push

hg update default

rename files

hg rename origin.js destination.js

stack trace on synck

 hg --debug -v [pull|push] 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment