Commits

Igor Támara committed 04c08ad

Translated svgs dummy .tex towards building

  • Participants
  • Parent commits d13a055

Comments (0)

Files changed (78)

 
  Branch: Rama
  Bug: Fallo
+ Changelog: Bitácora de Cambios
  Changeset: Conjunto de Cambios
  Command: Orden
  Commit: Consignar
+ Head: Principal
  Merge: Fusión
  Milestone: Etapa
+ Patch: Parche
+ Push: Publicar
  Release: Versión o liberación de versión
+ Revlog: Bitácora de revisiones
+ Snapshot: ¿? Traducir dentro de snapshot.svg revlog.svg
 
 = Para compilar =
 Todavía no hemos logrado, pero he aquí algunas dependencias :
 
-apt-get install texlive-latex-extra tex4ht
+apt-get install texlive-latex-extra tex4ht diffstat patchutils \ 
+   inkscape graphviz texlive-pdfetex
 
 = Traductores =
 Por favor mantenga esta lista en orden alfabético
+../en/bookhtml.cfg
+../en/cmdref.py

es/cmdref.tex

Empty file added.

es/collab.tex

Empty file added.

es/concepts.tex

Empty file added.

es/daily.tex

Empty file added.

es/examples/backout

+#!/bin/bash
+
+# We have to fake the merges here, because they cause conflicts with
+# three-way command-line merge, and kdiff3 may not be available.
+
+export HGMERGE=$(mktemp)
+echo '#!/bin/sh' >> $HGMERGE
+echo 'echo first change > "$1"' >> $HGMERGE
+echo 'echo third change >> "$1"' >> $HGMERGE
+chmod 700 $HGMERGE
+
+#$ name: init
+
+hg init myrepo
+cd myrepo
+echo first change >> myfile
+hg add myfile
+hg commit -m 'first change'
+echo second change >> myfile
+hg commit -m 'second change'
+
+#$ name: simple
+
+hg backout -m 'back out second change' tip
+cat myfile
+
+#$ name: simple.log
+#$ ignore: \s+200[78]-.*
+
+hg log --style compact
+
+#$ name: non-tip.clone
+
+cd ..
+hg clone -r1 myrepo non-tip-repo
+cd non-tip-repo
+
+#$ name: non-tip.backout
+
+echo third change >> myfile
+hg commit -m 'third change'
+hg backout --merge -m 'back out second change' 1
+
+#$ name: non-tip.cat
+cat myfile
+
+#$ name: manual.clone
+
+cd ..
+hg clone -r1 myrepo newrepo
+cd newrepo
+
+#$ name: manual.backout
+
+echo third change >> myfile
+hg commit -m 'third change'
+hg backout -m 'back out second change' 1
+
+#$ name: manual.log
+
+hg log --style compact
+
+#$ name: manual.parents
+
+hg parents
+
+#$ name: manual.heads
+
+hg heads
+
+#$ name: manual.cat
+
+cat myfile
+
+#$ name: manual.merge
+
+hg merge
+hg commit -m 'merged backout with previous tip'
+cat myfile
+
+#$ name:
+
+rm $HGMERGE

es/examples/bisect

+#!/bin/bash
+
+if  hg -v | head -1 | grep -e "version 0.*"
+then
+#On mercurial 1.0 and later bisect is a builtin
+echo '[extensions]' >> $HGRC
+echo 'hbisect =' >> $HGRC
+fi
+
+# XXX There's some kind of horrible nondeterminism in the execution of
+# bisect at the moment.  Ugh.
+
+#$ ignore: .*
+
+#$ name: init
+
+hg init mybug
+cd mybug
+
+#$ name: commits
+
+buggy_change=22
+
+for (( i = 0; i < 35; i++ )); do
+  if [[ $i = $buggy_change ]]; then
+    echo 'i have a gub' > myfile$i
+    hg commit -q -A -m 'buggy changeset'
+  else
+    echo 'nothing to see here, move along' > myfile$i
+    hg commit -q -A -m 'normal changeset'
+  fi
+done
+
+#$ name: help
+
+hg help bisect
+
+#$ name: search.init
+
+if  hg -v | head -1 | grep -e "version 0.*"
+then
+#On mercurial 1.0 --init disappeared
+hg bisect --init
+fi
+
+#$ name: search.bad-init
+
+hg bisect --bad
+
+#$ name: search.good-init
+
+hg bisect --good 10
+
+#$ name: search.step1
+
+if grep -q 'i have a gub' *
+then
+  result=bad
+else
+  result=good
+fi
+
+echo this revision is $result
+hg bisect --$result
+
+#$ name: search.mytest
+
+mytest() {
+  if grep -q 'i have a gub' *
+  then
+    result=bad
+  else
+    result=good
+  fi
+
+  echo this revision is $result
+  hg bisect --$result
+}
+  
+#$ name: search.step2
+
+mytest
+
+#$ name: search.rest
+
+mytest
+mytest
+mytest
+
+#$ name: search.reset
+
+hg bisect --reset
+
+#$ name:
+
+exit 0

es/examples/branch-named

+#!/bin/bash
+
+hg init a
+cd a
+echo hello > myfile
+hg commit -A -m 'Initial commit'
+
+#$ name: branches
+
+hg tip
+hg branches
+
+#$ name: branch
+
+hg branch
+
+#$ name: create
+
+hg branch foo
+hg branch
+
+#$ name: status
+
+hg status
+hg tip
+
+#$ name: commit
+
+echo 'hello again' >> myfile
+hg commit -m 'Second commit'
+hg tip
+
+#$ name: rebranch
+
+hg branch
+hg branch bar
+echo new file > newfile
+hg commit -A -m 'Third commit'
+hg tip
+
+#$ name: parents
+
+hg parents
+hg branches
+
+#$ name: update-switchy
+
+hg update foo
+hg parents
+hg update bar
+hg parents
+
+#$ name: update-nothing
+
+hg update foo
+hg update
+
+#$ name: foo-commit
+
+echo something > somefile
+hg commit -A -m 'New file'
+hg heads
+
+#$ name: update-bar
+
+hg update bar
+
+#$ name: merge
+
+hg branch
+hg merge foo
+hg commit -m 'Merge'
+hg tip

es/examples/branch-repo

+#!/bin/bash
+
+hg init myproject
+cd myproject
+echo hello > myfile
+hg commit -A -m 'Initial commit'
+cd ..
+
+#$ name: tag
+
+cd myproject
+hg tag v1.0
+
+#$ name: clone
+
+cd ..
+hg clone myproject myproject-1.0.1
+
+#$ name: bugfix
+
+hg clone myproject-1.0.1 my-1.0.1-bugfix
+cd my-1.0.1-bugfix
+echo 'I fixed a bug using only echo!' >> myfile
+hg commit -m 'Important fix for 1.0.1'
+#$ ignore: /tmp/branch-repo.*
+hg push
+
+#$ name: new
+
+cd ..
+hg clone myproject my-feature
+cd my-feature
+echo 'This sure is an exciting new feature!' > mynewfile
+hg commit -A -m 'New feature'
+hg push
+
+#$ name: pull
+
+cd ..
+hg clone myproject myproject-merge
+cd myproject-merge
+hg pull ../myproject-1.0.1
+
+#$ name: merge
+
+hg merge
+hg commit -m 'Merge bugfix from 1.0.1 branch'
+hg push

es/examples/branching

+#!/bin/bash
+
+#$ name: init
+
+hg init main
+cd main
+echo 'This is a boring feature.' > myfile
+hg commit -A -m 'We have reached an important milestone!'
+
+#$ name: tag
+
+hg tag v1.0
+hg tip
+hg tags
+
+#$ name: main
+
+cd ../main
+echo 'This is exciting and new!' >> myfile
+hg commit -m 'Add a new feature'
+cat myfile
+
+#$ name: update
+
+cd ..
+hg clone -U main main-old
+cd main-old
+hg update v1.0
+cat myfile
+
+#$ name: clone
+
+cd ..
+hg clone -rv1.0 main stable
+
+#$ name: stable
+
+hg clone stable stable-fix
+cd stable-fix
+echo 'This is a fix to a boring feature.' > myfile
+hg commit -m 'Fix a bug'
+#$ ignore: /tmp/branching.*
+hg push
+
+#$ name:
+
+export HGMERGE=$(mktemp)
+echo '#!/bin/sh' > $HGMERGE
+echo 'echo "This is a fix to a boring feature." > "$1"' >> $HGMERGE
+echo 'echo "This is exciting and new!" >> "$1"' >> $HGMERGE
+chmod 700 $HGMERGE
+
+#$ name: merge
+
+cd ../main
+hg pull ../stable
+hg merge
+hg commit -m 'Bring in bugfix from stable branch'
+cat myfile
+
+#$ name:
+
+rm $HGMERGE

es/examples/cmdref

+#!/bin/bash
+
+hg init diff
+cd diff
+cat > myfile.c <<EOF
+int myfunc()
+{
+    return 1;
+}
+EOF
+hg ci -Ama
+
+sed -ie 's/return 1/return 10/' myfile.c
+
+#$ name: diff-p
+
+echo '[diff]' >> $HGRC
+echo 'showfunc = False' >> $HGRC
+
+hg diff
+
+hg diff -p

es/examples/daily.copy

+#!/bin/bash
+
+#$ name: init
+
+hg init my-copy
+cd my-copy
+echo line > file
+hg add file
+hg commit -m 'Added a file'
+
+#$ name: clone
+
+cd ..
+hg clone my-copy your-copy
+
+#$ name: copy
+
+cd my-copy
+hg copy file new-file
+
+#$ name: status
+
+hg status
+
+#$ name: status-copy
+
+hg status -C
+hg commit -m 'Copied file'
+
+#$ name: other
+
+cd ../your-copy
+echo 'new contents' >> file
+hg commit -m 'Changed file'
+
+#$ name: cat
+
+cat file
+cat ../my-copy/new-file
+
+#$ name: merge
+
+hg pull ../my-copy
+hg merge
+cat new-file
+
+#$ name:
+
+cd ..
+hg init copy-example
+cd copy-example
+echo a > a
+echo b > b
+mkdir c
+mkdir c/a
+echo c > c/a/c
+hg ci -Ama
+
+#$ name: simple
+
+mkdir k
+hg copy a k
+ls k
+
+#$ name: dir-dest
+
+mkdir d
+hg copy a b d
+ls d
+
+#$ name: dir-src
+
+hg copy c e
+
+#$ name: dir-src-dest
+
+hg copy c d
+
+#$ name: after
+
+cp a z
+hg copy --after a z

es/examples/daily.files

+#!/bin/bash
+
+#$ name: add
+
+hg init add-example
+cd add-example
+echo a > a
+hg status
+hg add a
+hg status
+hg commit -m 'Added one file'
+hg status
+
+#$ name: add-dir
+
+mkdir b
+echo b > b/b
+echo c > b/c
+mkdir b/d
+echo d > b/d/d
+hg add b
+hg commit -m 'Added all files in subdirectory'
+
+#$ name:
+
+cd ..
+
+#$ name: hidden
+
+hg init hidden-example
+cd hidden-example
+mkdir empty
+touch empty/.hidden
+hg add empty/.hidden
+hg commit -m 'Manage an empty-looking directory'
+ls empty
+cd ..
+hg clone hidden-example tmp
+ls tmp
+ls tmp/empty
+
+#$ name: remove
+
+hg init remove-example
+cd remove-example
+echo a > a
+mkdir b
+echo b > b/b
+hg add a b
+hg commit -m 'Small example for file removal'
+hg remove a
+hg status
+hg remove b
+
+#$ name:
+
+cd ..
+
+#$ name: missing
+hg init missing-example
+cd missing-example
+echo a > a
+hg add a
+hg commit -m 'File about to be missing'
+rm a
+hg status
+
+#$ name: remove-after
+
+hg remove --after a
+hg status
+
+#$ name: recover-missing
+hg revert a
+cat a
+hg status
+
+#$ name:
+
+cd ..
+
+#$ name: addremove
+
+hg init addremove-example
+cd addremove-example
+echo a > a
+echo b > b
+hg addremove
+
+#$ name: commit-addremove
+
+echo c > c
+hg commit -A -m 'Commit with addremove'

es/examples/daily.rename

+#!/bin/bash
+
+hg init a
+cd a
+echo a > a
+hg ci -Ama
+
+#$ name: rename
+
+hg rename a b
+
+#$ name: status
+
+hg status
+
+#$ name: status-copy
+
+hg status -C

es/examples/daily.revert

+#!/bin/bash
+
+hg init a
+cd a
+echo 'original content' > file
+hg ci -Ama
+
+#$ name: modify
+
+cat file
+echo unwanted change >> file
+hg diff file
+
+#$ name: unmodify
+
+hg status
+hg revert file
+cat file
+
+#$ name: status
+
+hg status
+cat file.orig
+
+#$ name:
+
+rm file.orig
+
+#$ name: add
+
+echo oops > oops
+hg add oops
+hg status oops
+hg revert oops
+hg status
+
+#$ name:
+
+rm oops
+
+#$ name: remove
+
+hg remove file
+hg status
+hg revert file
+hg status
+ls file
+
+#$ name: missing
+
+rm file
+hg status
+hg revert file
+ls file
+
+#$ name: copy
+
+hg copy file new-file
+hg revert new-file
+hg status
+
+#$ name:
+
+rm new-file
+
+#$ name: rename
+
+hg rename file new-file
+hg revert new-file
+hg status
+
+#$ name: rename-orig
+hg revert file
+hg status

es/examples/data/check_whitespace.py

+#!/usr/bin/python
+
+import re
+
+def trailing_whitespace(difflines):
+    added, linenum, header = [], 0, False
+
+    for line in difflines:
+        if header:
+            # remember the name of the file that this diff affects
+            m = re.match(r'(?:---|\+\+\+) ([^\t]+)', line)
+            if m and m.group(1) != '/dev/null':
+                filename = m.group(1).split('/', 1)[-1]
+            if line.startswith('+++ '):
+                header = False
+            continue
+        if line.startswith('diff '):
+            header = True
+            continue
+        # hunk header - save the line number
+        m = re.match(r'@@ -\d+,\d+ \+(\d+),', line)
+        if m:
+            linenum = int(m.group(1))
+            continue
+        # hunk body - check for an added line with trailing whitespace
+        m = re.match(r'\+.*\s$', line)
+        if m:
+            added.append((filename, linenum))
+        if line and line[0] in ' +':
+            linenum += 1
+    return added
+
+if __name__ == '__main__':
+    import os, sys
+    
+    added = trailing_whitespace(os.popen('hg export tip'))
+    if added:
+        for filename, linenum in added:
+            print >> sys.stderr, ('%s, line %d: trailing whitespace added' %
+                                  (filename, linenum))
+        # save the commit message so we don't need to retype it
+        os.system('hg tip --template "{desc}" > .hg/commit.save')
+        print >> sys.stderr, 'commit message saved to .hg/commit.save'
+        sys.exit(1)

es/examples/data/netplug-1.2.5.tar.bz2

Binary file added.

es/examples/data/netplug-1.2.8.tar.bz2

Binary file added.

es/examples/data/remove-redundant-null-checks.patch

+
+From: Jesper Juhl <jesper.juhl@gmail.com>
+
+Remove redundant NULL chck before kfree + tiny CodingStyle cleanup for
+drivers/
+
+Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+---
+
+ drivers/char/agp/sgi-agp.c        |    5 ++---
+ drivers/char/hvcs.c               |   11 +++++------
+ drivers/message/fusion/mptfc.c    |    6 ++----
+ drivers/message/fusion/mptsas.c   |    3 +--
+ drivers/net/fs_enet/fs_enet-mii.c |    3 +--
+ drivers/net/wireless/ipw2200.c    |   22 ++++++----------------
+ drivers/scsi/libata-scsi.c        |    4 +---
+ drivers/video/au1100fb.c          |    3 +--
+ 8 files changed, 19 insertions(+), 38 deletions(-)
+
+diff -puN drivers/char/agp/sgi-agp.c~remove-redundant-null-checks-before-free-in-drivers drivers/char/agp/sgi-agp.c
+--- a/drivers/char/agp/sgi-agp.c~remove-redundant-null-checks-before-free-in-drivers
++++ a/drivers/char/agp/sgi-agp.c
+@@ -329,9 +329,8 @@ static int __devinit agp_sgi_init(void)
+ 
+ static void __devexit agp_sgi_cleanup(void)
+ {
+-	if (sgi_tioca_agp_bridges)
+-		kfree(sgi_tioca_agp_bridges);
+-	sgi_tioca_agp_bridges=NULL;
++	kfree(sgi_tioca_agp_bridges);
++	sgi_tioca_agp_bridges = NULL;
+ }
+ 
+ module_init(agp_sgi_init);
+diff -puN drivers/char/hvcs.c~remove-redundant-null-checks-before-free-in-drivers drivers/char/hvcs.c
+--- a/drivers/char/hvcs.c~remove-redundant-null-checks-before-free-in-drivers
++++ a/drivers/char/hvcs.c
+@@ -1320,11 +1320,12 @@ static struct tty_operations hvcs_ops = 
+ static int hvcs_alloc_index_list(int n)
+ {
+ 	int i;
++
+ 	hvcs_index_list = kmalloc(n * sizeof(hvcs_index_count),GFP_KERNEL);
+ 	if (!hvcs_index_list)
+ 		return -ENOMEM;
+ 	hvcs_index_count = n;
+-	for(i = 0; i < hvcs_index_count; i++)
++	for (i = 0; i < hvcs_index_count; i++)
+ 		hvcs_index_list[i] = -1;
+ 	return 0;
+ }
+@@ -1332,11 +1333,9 @@ static int hvcs_alloc_index_list(int n)
+ static void hvcs_free_index_list(void)
+ {
+ 	/* Paranoia check to be thorough. */
+-	if (hvcs_index_list) {
+-		kfree(hvcs_index_list);
+-		hvcs_index_list = NULL;
+-		hvcs_index_count = 0;
+-	}
++	kfree(hvcs_index_list);
++	hvcs_index_list = NULL;
++	hvcs_index_count = 0;
+ }
+ 
+ static int __init hvcs_module_init(void)
+diff -puN drivers/message/fusion/mptfc.c~remove-redundant-null-checks-before-free-in-drivers drivers/message/fusion/mptfc.c
+--- a/drivers/message/fusion/mptfc.c~remove-redundant-null-checks-before-free-in-drivers
++++ a/drivers/message/fusion/mptfc.c
+@@ -305,10 +305,8 @@ mptfc_GetFcDevPage0(MPT_ADAPTER *ioc, in
+ 	}
+ 
+  out:
+-	if (pp0_array)
+-		kfree(pp0_array);
+-	if (p0_array)
+-		kfree(p0_array);
++	kfree(pp0_array);
++	kfree(p0_array);
+ 	return rc;
+ }
+ 
+diff -puN drivers/message/fusion/mptsas.c~remove-redundant-null-checks-before-free-in-drivers drivers/message/fusion/mptsas.c
+--- a/drivers/message/fusion/mptsas.c~remove-redundant-null-checks-before-free-in-drivers
++++ a/drivers/message/fusion/mptsas.c
+@@ -1378,8 +1378,7 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
+ 	return 0;
+ 
+  out_free_port_info:
+-	if (hba)
+-		kfree(hba);
++	kfree(hba);
+  out:
+ 	return error;
+ }
+diff -puN drivers/net/fs_enet/fs_enet-mii.c~remove-redundant-null-checks-before-free-in-drivers drivers/net/fs_enet/fs_enet-mii.c
+--- a/drivers/net/fs_enet/fs_enet-mii.c~remove-redundant-null-checks-before-free-in-drivers
++++ a/drivers/net/fs_enet/fs_enet-mii.c
+@@ -431,8 +431,7 @@ static struct fs_enet_mii_bus *create_bu
+ 	return bus;
+ 
+ err:
+-	if (bus)
+-		kfree(bus);
++	kfree(bus);
+ 	return ERR_PTR(ret);
+ }
+ 
+diff -puN drivers/net/wireless/ipw2200.c~remove-redundant-null-checks-before-free-in-drivers drivers/net/wireless/ipw2200.c
+--- a/drivers/net/wireless/ipw2200.c~remove-redundant-null-checks-before-free-in-drivers
++++ a/drivers/net/wireless/ipw2200.c
+@@ -1229,12 +1229,6 @@ static struct ipw_fw_error *ipw_alloc_er
+ 	return error;
+ }
+ 
+-static void ipw_free_error_log(struct ipw_fw_error *error)
+-{
+-	if (error)
+-		kfree(error);
+-}
+-
+ static ssize_t show_event_log(struct device *d,
+ 			      struct device_attribute *attr, char *buf)
+ {
+@@ -1296,10 +1290,9 @@ static ssize_t clear_error(struct device
+ 			   const char *buf, size_t count)
+ {
+ 	struct ipw_priv *priv = dev_get_drvdata(d);
+-	if (priv->error) {
+-		ipw_free_error_log(priv->error);
+-		priv->error = NULL;
+-	}
++
++	kfree(priv->error);
++	priv->error = NULL;
+ 	return count;
+ }
+ 
+@@ -1970,8 +1963,7 @@ static void ipw_irq_tasklet(struct ipw_p
+ 				struct ipw_fw_error *error =
+ 				    ipw_alloc_error_log(priv);
+ 				ipw_dump_error_log(priv, error);
+-				if (error)
+-					ipw_free_error_log(error);
++				kfree(error);
+ 			}
+ #endif
+ 		} else {
+@@ -11693,10 +11685,8 @@ static void ipw_pci_remove(struct pci_de
+ 		}
+ 	}
+ 
+-	if (priv->error) {
+-		ipw_free_error_log(priv->error);
+-		priv->error = NULL;
+-	}
++	kfree(priv->error);
++	priv->error = NULL;
+ 
+ #ifdef CONFIG_IPW2200_PROMISCUOUS
+ 	ipw_prom_free(priv);
+diff -puN drivers/scsi/libata-scsi.c~remove-redundant-null-checks-before-free-in-drivers drivers/scsi/libata-scsi.c
+--- a/drivers/scsi/libata-scsi.c~remove-redundant-null-checks-before-free-in-drivers
++++ a/drivers/scsi/libata-scsi.c
+@@ -222,9 +222,7 @@ int ata_cmd_ioctl(struct scsi_device *sc
+ 	 && copy_to_user(arg + sizeof(args), argbuf, argsize))
+ 		rc = -EFAULT;
+ error:
+-	if (argbuf)
+-		kfree(argbuf);
+-
++	kfree(argbuf);
+ 	return rc;
+ }
+ 
+diff -puN drivers/video/au1100fb.c~remove-redundant-null-checks-before-free-in-drivers drivers/video/au1100fb.c
+--- a/drivers/video/au1100fb.c~remove-redundant-null-checks-before-free-in-drivers
++++ a/drivers/video/au1100fb.c
+@@ -743,8 +743,7 @@ void __exit au1100fb_cleanup(void)
+ {
+ 	driver_unregister(&au1100fb_driver);
+ 
+-	if (drv_info.opt_mode)
+-		kfree(drv_info.opt_mode);
++	kfree(drv_info.opt_mode);
+ }
+ 
+ module_init(au1100fb_init);
+_

es/examples/extdiff

+#!/bin/bash
+
+echo '[extensions]' >> $HGRC
+echo 'extdiff =' >> $HGRC
+
+hg init a
+cd a
+echo 'The first line.' > myfile
+hg ci -Ama
+echo 'The second line.' >> myfile
+
+#$ name: diff
+
+hg diff
+
+#$ name: extdiff
+
+hg extdiff
+
+#$ name: extdiff-ctx
+
+#$ ignore: ^\*\*\* a.*
+
+hg extdiff -o -NprcC5
+
+#$ name:
+
+exit 0

es/examples/filenames

+#!/bin/bash
+
+hg init a
+cd a
+mkdir -p examples src/watcher
+touch COPYING MANIFEST.in README setup.py
+touch examples/performant.py examples/simple.py
+touch src/main.py src/watcher/_watcher.c src/watcher/watcher.py src/xyzzy.txt
+
+#$ name: files
+
+hg add COPYING README examples/simple.py
+
+#$ name: dirs
+
+hg status src
+
+#$ name: wdir-subdir
+
+cd src
+hg add -n
+hg add -n .
+
+#$ name: wdir-relname
+
+hg status
+hg status `hg root`
+
+#$ name: glob.star
+
+hg add 'glob:*.py'
+
+#$ name: glob.starstar
+
+cd ..
+hg status 'glob:**.py'
+
+#$ name: glob.star-starstar
+
+hg status 'glob:*.py'
+hg status 'glob:**.py'
+
+#$ name: glob.question
+
+hg status 'glob:**.?'
+
+#$ name: glob.range
+
+hg status 'glob:**[nr-t]'
+
+#$ name: glob.group
+
+hg status 'glob:*.{in,py}'
+
+#$ name: filter.include
+
+hg status -I '*.in'
+
+#$ name: filter.exclude
+
+hg status -X '**.py' src

es/examples/hook.msglen

+#!/bin/sh
+
+hg init a
+cd a
+echo '[hooks]' > .hg/hgrc
+echo 'pretxncommit.msglen = test `hg tip --template {desc} | wc -c` -ge 10' >> .hg/hgrc
+
+#$ name: go
+
+cat .hg/hgrc
+echo a > a
+hg add a
+hg commit -A -m 'too short'
+hg commit -A -m 'long enough'

es/examples/hook.simple

+#!/bin/bash
+
+#$ name: init
+
+hg init hook-test
+cd hook-test
+echo '[hooks]' >> .hg/hgrc
+echo 'commit = echo committed $HG_NODE' >> .hg/hgrc
+cat .hg/hgrc
+echo a > a
+hg add a
+hg commit -m 'testing commit hook'
+
+#$ name: ext
+#$ ignore: ^date of commit.*
+
+echo 'commit.when = echo -n "date of commit: "; date' >> .hg/hgrc
+echo a >> a
+hg commit -m 'i have two hooks'
+
+#$ name:
+
+echo '#!/bin/sh' >> check_bug_id
+echo '# check that a commit comment mentions a numeric bug id' >> check_bug_id
+echo 'hg log -r $1 --template {desc} | grep -q "\<bug *[0-9]"' >> check_bug_id
+chmod +x check_bug_id
+
+#$ name: pretxncommit
+
+cat check_bug_id
+
+echo 'pretxncommit.bug_id_required = ./check_bug_id $HG_NODE' >> .hg/hgrc
+
+echo a >> a
+hg commit -m 'i am not mentioning a bug id'
+
+hg commit -m 'i refer you to bug 666'

es/examples/hook.ws

+#!/bin/bash
+
+hg init a
+cd a
+echo '[hooks]' > .hg/hgrc
+echo "pretxncommit.whitespace = hg export tip | (! egrep -q '^\\+.*[ \\t]$')" >> .hg/hgrc
+
+#$ name: simple
+
+cat .hg/hgrc
+echo 'a ' > a
+hg commit -A -m 'test with trailing whitespace'
+echo 'a' > a
+hg commit -A -m 'drop trailing whitespace and try again'
+
+#$ name:
+
+echo '[hooks]' > .hg/hgrc
+echo "pretxncommit.whitespace = .hg/check_whitespace.py" >> .hg/hgrc
+cp $EXAMPLE_DIR/data/check_whitespace.py .hg
+
+#$ name: better
+
+cat .hg/hgrc
+echo 'a ' >> a
+hg commit -A -m 'add new line with trailing whitespace'
+sed -i 's, *$,,' a
+hg commit -A -m 'trimmed trailing whitespace'
+
+#$ name:
+exit 0

es/examples/issue29

+#!/bin/bash
+
+#$ name: go
+
+hg init issue29
+cd issue29
+echo a > a
+hg ci -Ama
+echo b > b
+hg ci -Amb
+hg up 0
+mkdir b
+echo b > b/b
+hg ci -Amc
+
+#$ ignore: abort: Is a directory: .*
+hg merge
+
+#$ name:
+# This error is expected from the failed merge.
+
+exit 0

es/examples/mq.dodiff

+#!/bin/bash
+
+#$ name: diff
+
+echo 'this is my original thought' > oldfile
+echo 'i have changed my mind' > newfile
+
+diff -u oldfile newfile > tiny.patch
+
+cat tiny.patch
+
+patch < tiny.patch
+
+cat oldfile

es/examples/mq.guards

+#!/bin/bash
+
+echo '[extensions]' >> $HGRC
+echo 'hgext.mq =' >> $HGRC
+
+hg init a
+cd a
+
+#$ name: init
+
+hg qinit
+hg qnew hello.patch
+echo hello > hello
+hg add hello
+hg qrefresh
+hg qnew goodbye.patch
+echo goodbye > goodbye
+hg add goodbye
+hg qrefresh
+
+#$ name: qguard
+
+hg qguard
+
+#$ name: qguard.pos
+
+hg qguard +foo
+hg qguard
+
+#$ name: qguard.neg
+
+hg qguard hello.patch -quux
+hg qguard hello.patch
+
+#$ name: series
+
+cat .hg/patches/series
+
+#$ name: qselect.foo
+
+hg qpop -a
+hg qselect
+hg qselect foo
+hg qselect
+
+#$ name: qselect.cat
+
+cat .hg/patches/guards
+
+#$ name: qselect.qpush
+hg qpush -a
+
+#$ name: qselect.error
+
+hg qselect +foo
+
+#$ name: qselect.quux
+
+hg qselect quux
+hg qpop -a
+hg qpush -a
+
+#$ name: qselect.foobar
+
+hg qselect foo bar
+hg qpop -a
+hg qpush -a

es/examples/mq.id

+#!/bin/sh
+
+echo '[extensions]' >> $HGRC
+echo 'hgext.mq =' >> $HGRC
+
+hg init a
+cd a
+hg qinit
+echo 'int x;' > test.c
+hg ci -Ama
+
+hg qnew first.patch
+echo 'float c;' >> test.c
+hg qrefresh
+
+hg qnew second.patch
+echo 'double u;' > other.c
+hg add other.c
+hg qrefresh
+
+#$ name: output
+
+hg qapplied
+hg log -r qbase:qtip
+hg export second.patch
+
+#$ name:
+exit 0

es/examples/mq.qinit-help

+#!/bin/bash
+
+echo '[extensions]' >> $HGRC
+echo 'hgext.mq =' >> $HGRC
+
+#$ name: help
+hg help qinit

es/examples/mq.tarball

+#!/bin/bash
+
+cp $EXAMPLE_DIR/data/netplug-*.tar.bz2 .
+ln -s /bin/true download
+export PATH=`pwd`:$PATH
+
+#$ name: download
+
+download netplug-1.2.5.tar.bz2
+tar jxf netplug-1.2.5.tar.bz2
+cd netplug-1.2.5
+hg init
+hg commit -q --addremove --message netplug-1.2.5
+cd ..
+hg clone netplug-1.2.5 netplug
+
+#$ name:
+
+cd netplug
+echo '[extensions]' >> $HGRC
+echo 'hgext.mq =' >> $HGRC
+cd ..
+
+#$ name: qinit
+
+cd netplug
+hg qinit
+hg qnew -m 'fix build problem with gcc 4' build-fix.patch
+perl -pi -e 's/int addr_len/socklen_t addr_len/' netlink.c
+hg qrefresh
+hg tip -p
+
+#$ name: newsource
+
+hg qpop -a
+cd ..
+download netplug-1.2.8.tar.bz2
+hg clone netplug-1.2.5 netplug-1.2.8
+cd netplug-1.2.8
+hg locate -0 | xargs -0 rm
+cd ..
+tar jxf netplug-1.2.8.tar.bz2
+cd netplug-1.2.8
+hg commit --addremove --message netplug-1.2.8
+
+#$ name: repush
+
+cd ../netplug
+hg pull ../netplug-1.2.8
+hg qpush -a
+

es/examples/mq.tools

+#!/bin/bash
+
+cp $EXAMPLE_DIR/data/remove-redundant-null-checks.patch .
+
+#$ name: tools
+diffstat -p1 remove-redundant-null-checks.patch
+
+filterdiff -i '*/video/*' remove-redundant-null-checks.patch
+
+#$ name: lsdiff
+lsdiff -nvv remove-redundant-null-checks.patch

es/examples/mq.tutorial

+#!/bin/bash
+
+echo '[extensions]' >> $HGRC
+echo 'hgext.mq =' >> $HGRC
+
+#$ name: qinit
+
+hg init mq-sandbox
+cd mq-sandbox
+echo 'line 1' > file1
+echo 'another line 1' > file2
+hg add file1 file2
+hg commit -m'first change'
+
+hg qinit
+
+#$ name: qnew
+
+hg tip
+hg qnew first.patch
+hg tip
+ls .hg/patches
+
+#$ name: qrefresh
+#$ ignore: \s+200[78]-.*
+
+echo 'line 2' >> file1
+hg diff
+hg qrefresh
+hg diff
+hg tip --style=compact --patch
+
+#$ name: qrefresh2
+
+echo 'line 3' >> file1
+hg status
+hg qrefresh
+hg tip --style=compact --patch
+
+#$ name: qnew2
+
+hg qnew second.patch
+hg log --style=compact --limit=2
+echo 'line 4' >> file1
+hg qrefresh
+hg tip --style=compact --patch
+hg annotate file1
+
+#$ name: qseries
+
+hg qseries
+hg qapplied
+
+#$ name: qpop
+
+hg qapplied
+hg qpop
+hg qseries
+hg qapplied
+cat file1
+
+#$ name: qpush-a
+
+hg qpush -a
+cat file1
+
+#$ name: add
+
+echo 'file 3, line 1' >> file3
+hg qnew add-file3.patch
+hg qnew -f add-file3.patch
+
+#$ name:
+exit 0

es/examples/rename.divergent

+#!/bin/bash
+
+hg init orig
+cd orig
+echo foo > foo
+hg ci -A -m 'First commit'
+cd ..
+
+#$ name: clone
+
+hg clone orig anne
+hg clone orig bob
+
+#$ name: rename.anne
+
+cd anne
+hg mv foo bar
+hg ci -m 'Rename foo to bar'
+
+#$ name: rename.bob
+
+cd ../bob
+hg mv foo quux
+hg ci -m 'Rename foo to quux'
+
+#$ name: merge
+# See http://www.selenic.com/mercurial/bts/issue455
+
+cd ../orig
+hg pull -u ../anne
+hg pull ../bob
+hg merge
+ls

es/examples/rollback

+#!/bin/bash
+
+hg init a
+cd a
+echo a > a
+hg ci -A -m 'First commit'
+
+echo a >> a
+
+#$ name: tip
+
+#$ name: commit
+
+hg status
+echo b > b
+hg commit -m 'Add file b'
+
+#$ name: status
+
+hg status
+hg tip
+
+#$ name: rollback
+
+hg rollback
+hg tip
+hg status
+
+#$ name: add
+
+hg add b
+hg commit -m 'Add file b, this time for real'
+
+#$ name: twice
+
+hg rollback
+hg rollback

es/examples/run-example

+#!/usr/bin/env python
+#
+# This program takes something that resembles a shell script and runs
+# it, spitting input (commands from the script) and output into text
+# files, for use in examples.
+
+import cStringIO
+import errno
+import getopt
+import os
+import pty
+import re
+import select
+import shutil
+import signal
+import stat
+import sys
+import tempfile
+import time
+
+tex_subs = {
+    '\\': '\\textbackslash{}',
+    '{': '\\{',
+    '}': '\\}',
+    }
+
+def gensubs(s):
+    start = 0
+    for i, c in enumerate(s):
+        sub = tex_subs.get(c)
+        if sub:
+            yield s[start:i]
+            start = i + 1
+            yield sub
+    yield s[start:]
+
+def tex_escape(s):
+    return ''.join(gensubs(s))
+        
+def maybe_unlink(name):
+    try:
+        os.unlink(name)
+        return True
+    except OSError, err:
+        if err.errno != errno.ENOENT:
+            raise
+    return False
+
+def find_path_to(program):
+    for p in os.environ.get('PATH', os.defpath).split(os.pathsep):
+        name = os.path.join(p, program)
+        if os.access(name, os.X_OK):
+            return p
+    return None
+        
+class example:
+    shell = '/usr/bin/env bash'
+    ps1 = '__run_example_ps1__ '
+    ps2 = '__run_example_ps2__ '
+    pi_re = re.compile(r'#\$\s*(name|ignore):\s*(.*)$')
+    
+    timeout = 10
+
+    def __init__(self, name, verbose):
+        self.name = name
+        self.verbose = verbose
+        self.poll = select.poll()
+
+    def parse(self):
+        '''yield each hunk of input from the file.'''
+        fp = open(self.name)
+        cfp = cStringIO.StringIO()
+        for line in fp:
+            cfp.write(line)
+            if not line.rstrip().endswith('\\'):
+                yield cfp.getvalue()
+                cfp.seek(0)
+                cfp.truncate()
+        
+    def status(self, s):
+        sys.stdout.write(s)
+        if not s.endswith('\n'):
+            sys.stdout.flush()
+
+    def send(self, s):
+        if self.verbose:
+            print >> sys.stderr, '>', self.debugrepr(s)
+        while s:
+            count = os.write(self.cfd, s)
+            s = s[count:]
+
+    def debugrepr(self, s):
+        rs = repr(s)
+        limit = 60
+        if len(rs) > limit:
+            return ('%s%s ... [%d bytes]' % (rs[:limit], rs[0], len(s)))
+        else:
+            return rs
+            
+    timeout = 5
+
+    def read(self, hint):
+        events = self.poll.poll(self.timeout * 1000)
+        if not events:
+            print >> sys.stderr, ('[%stimed out after %d seconds]' %
+                                  (hint, self.timeout))
+            os.kill(self.pid, signal.SIGHUP)
+            return ''
+        return os.read(self.cfd, 1024)
+        
+    def receive(self, hint):
+        out = cStringIO.StringIO()
+        while True:
+            try:
+                if self.verbose:
+                    sys.stderr.write('< ')
+                s = self.read(hint)
+            except OSError, err:
+                if err.errno == errno.EIO:
+                    return '', ''
+                raise
+            if self.verbose:
+                print >> sys.stderr, self.debugrepr(s)
+            out.write(s)
+            s = out.getvalue()
+            if s.endswith(self.ps1):
+                return self.ps1, s.replace('\r\n', '\n')[:-len(self.ps1)]
+            if s.endswith(self.ps2):
+                return self.ps2, s.replace('\r\n', '\n')[:-len(self.ps2)]
+        
+    def sendreceive(self, s, hint):
+        self.send(s)
+        ps, r = self.receive(hint)
+        if r.startswith(s):
+            r = r[len(s):]
+        return ps, r
+    
+    def run(self):
+        ofp = None
+        basename = os.path.basename(self.name)
+        self.status('running %s ' % basename)
+        tmpdir = tempfile.mkdtemp(prefix=basename)
+
+        # remove the marker file that we tell make to use to see if
+        # this run succeeded
+        maybe_unlink(self.name + '.run')
+
+        rcfile = os.path.join(tmpdir, '.hgrc')
+        rcfp = open(rcfile, 'w')
+        print >> rcfp, '[ui]'
+        print >> rcfp, "username = Bryan O'Sullivan <bos@serpentine.com>"
+        
+        rcfile = os.path.join(tmpdir, '.bashrc')
+        rcfp = open(rcfile, 'w')
+        print >> rcfp, 'PS1="%s"' % self.ps1
+        print >> rcfp, 'PS2="%s"' % self.ps2
+        print >> rcfp, 'unset HISTFILE'
+        path = ['/usr/bin', '/bin']
+        hg = find_path_to('hg')
+        if hg and hg not in path:
+            path.append(hg)
+        def re_export(envar):
+            v = os.getenv(envar)
+            if v is not None:
+                print >> rcfp, 'export ' + envar + '=' + v
+        print >> rcfp, 'export PATH=' + ':'.join(path)
+        re_export('PYTHONPATH')
+        print >> rcfp, 'export EXAMPLE_DIR="%s"' % os.getcwd()
+        print >> rcfp, 'export HGMERGE=merge'
+        print >> rcfp, 'export LANG=C'
+        print >> rcfp, 'export LC_ALL=C'
+        print >> rcfp, 'export TZ=GMT'
+        print >> rcfp, 'export HGRC="%s/.hgrc"' % tmpdir
+        print >> rcfp, 'export HGRCPATH=$HGRC'
+        print >> rcfp, 'cd %s' % tmpdir
+        rcfp.close()
+        sys.stdout.flush()
+        sys.stderr.flush()
+        self.pid, self.cfd = pty.fork()
+        if self.pid == 0:
+            cmdline = ['/usr/bin/env', '-i', 'bash', '--noediting',
+                       '--noprofile', '--norc']
+            try:
+                os.execv(cmdline[0], cmdline)
+            except OSError, err:
+                print >> sys.stderr, '%s: %s' % (cmdline[0], err.strerror)
+                sys.stderr.flush()
+                os._exit(0)
+        self.poll.register(self.cfd, select.POLLIN | select.POLLERR |
+                           select.POLLHUP)
+
+        prompts = {
+            '': '',
+            self.ps1: '$',
+            self.ps2: '>',
+            }
+
+        ignore = [
+            r'\d+:[0-9a-f]{12}', # changeset number:hash
+            r'[0-9a-f]{40}', # long changeset hash
+            r'[0-9a-f]{12}', # short changeset hash
+            r'^(?:---|\+\+\+) .*', # diff header with dates
+            r'^date:.*', # date
+            #r'^diff -r.*', # "diff -r" is followed by hash
+            r'^# Date \d+ \d+', # hg patch header
+            ]
+
+        err = False
+        read_hint = ''
+
+        try:
+            try:
+                # eat first prompt string from shell
+                self.read(read_hint)
+                # setup env and prompt
+                ps, output = self.sendreceive('source %s\n' % rcfile,
+                                              read_hint)
+                for hunk in self.parse():
+                    # is this line a processing instruction?
+                    m = self.pi_re.match(hunk)
+                    if m:
+                        pi, rest = m.groups()
+                        if pi == 'name':
+                            self.status('.')
+                            out = rest
+                            if out in ('err', 'lxo', 'out', 'run', 'tmp'):
+                                print >> sys.stderr, ('%s: illegal section '
+                                                      'name %r' %
+                                                      (self.name, out))
+                                return 1
+                            assert os.sep not in out
+                            if ofp is not None:
+                                ofp.close()
+                                err |= self.rename_output(ofp_basename, ignore)
+                            if out:
+                                ofp_basename = '%s.%s' % (self.name, out)
+                                read_hint = ofp_basename + ' '
+                                ofp = open(ofp_basename + '.tmp', 'w')
+                            else:
+                                ofp = None
+                        elif pi == 'ignore':
+                            ignore.append(rest)
+                    elif hunk.strip():
+                        # it's something we should execute
+                        newps, output = self.sendreceive(hunk, read_hint)
+                        if not ofp:
+                            continue
+                        # first, print the command we ran
+                        if not hunk.startswith('#'):
+                            nl = hunk.endswith('\n')
+                            hunk = ('%s \\textbf{%s}' %
+                                    (prompts[ps],
+                                     tex_escape(hunk.rstrip('\n'))))
+                            if nl: hunk += '\n'
+                        ofp.write(hunk)
+                        # then its output
+                        ofp.write(tex_escape(output))
+                    ps = newps
+                self.status('\n')
+            except:
+                print >> sys.stderr, '(killed)'
+                os.kill(self.pid, signal.SIGKILL)
+                pid, rc = os.wait()
+                raise
+            else:
+                try:
+                    ps, output = self.sendreceive('exit\n', read_hint)
+                    if ofp is not None:
+                        ofp.write(output)
+                        ofp.close()
+                        err |= self.rename_output(ofp_basename, ignore)
+                    os.close(self.cfd)
+                except IOError:
+                    pass
+                os.kill(self.pid, signal.SIGTERM)
+                pid, rc = os.wait()
+                err = err or rc
+                if err:
+                    if os.WIFEXITED(rc):
+                        print >> sys.stderr, '(exit %s)' % os.WEXITSTATUS(rc)
+                    elif os.WIFSIGNALED(rc):
+                        print >> sys.stderr, '(signal %s)' % os.WTERMSIG(rc)
+                else:
+                    open(self.name + '.run', 'w')
+                return err
+        finally:
+            shutil.rmtree(tmpdir)
+
+    def rename_output(self, base, ignore):
+        mangle_re = re.compile('(?:' + '|'.join(ignore) + ')')
+        def mangle(s):
+            return mangle_re.sub('', s)
+        def matchfp(fp1, fp2):
+            while True:
+                s1 = mangle(fp1.readline())
+                s2 = mangle(fp2.readline())
+                if cmp(s1, s2):
+                    break
+                if not s1:
+                    return True
+            return False
+
+        oldname = base + '.out'
+        tmpname = base + '.tmp'
+        errname = base + '.err'
+        errfp = open(errname, 'w+')
+        for line in open(tmpname):
+            errfp.write(mangle_re.sub('', line))
+        os.rename(tmpname, base + '.lxo')
+        errfp.seek(0)
+        try:
+            oldfp = open(oldname)
+        except IOError, err:
+            if err.errno != errno.ENOENT:
+                raise
+            os.rename(errname, oldname)
+            return False
+        if matchfp(oldfp, errfp):
+            os.unlink(errname)
+            return False
+        else:
+            print >> sys.stderr, '\nOutput of %s has changed!' % base
+            os.system('diff -u %s %s 1>&2' % (oldname, errname))
+            return True
+
+def print_help(exit, msg=None):
+    if msg:
+        print >> sys.stderr, 'Error:', msg
+    print >> sys.stderr, 'Usage: run-example [options] [test...]'
+    print >> sys.stderr, 'Options:'
+    print >> sys.stderr, '  -a --all       run all tests in this directory'
+    print >> sys.stderr, '  -h --help      print this help message'
+    print >> sys.stderr, '  -v --verbose   display extra debug output'
+    sys.exit(exit)
+
+def main(path='.'):
+    opts, args = getopt.getopt(sys.argv[1:], '?ahv',
+                               ['all', 'help', 'verbose'])
+    verbose = False
+    run_all = False
+    for o, a in opts:
+        if o in ('-h', '-?', '--help'):
+            print_help(0)
+        if o in ('-a', '--all'):
+            run_all = True
+        if o in ('-v', '--verbose'):
+            verbose = True
+    errs = 0
+    if args:
+        for a in args:
+            try:
+                st = os.lstat(a)
+            except OSError, err:
+                print >> sys.stderr, '%s: %s' % (a, err.strerror)
+                errs += 1
+                continue
+            if stat.S_ISREG(st.st_mode) and st.st_mode & 0111:
+                if example(a, verbose).run():
+                    errs += 1
+            else:
+                print >> sys.stderr, '%s: not a file, or not executable' % a
+                errs += 1
+    elif run_all:
+        names = os.listdir(path)
+        names.sort()
+        for name in names:
+            if name == 'run-example' or name.startswith('.'): continue
+            if name.endswith('.out') or name.endswith('~'): continue
+            if name.endswith('.run'): continue
+            pathname = os.path.join(path, name)
+            try:
+                st = os.lstat(pathname)
+            except OSError, err:
+                # could be an output file that was removed while we ran
+                if err.errno != errno.ENOENT:
+                    raise
+                continue
+            if stat.S_ISREG(st.st_mode) and st.st_mode & 0111:
+                if example(pathname, verbose).run():
+                    errs += 1
+        print >> open(os.path.join(path, '.run'), 'w'), time.asctime()
+    else:
+        print_help(1, msg='no test names given, and --all not provided')
+    return errs
+
+if __name__ == '__main__':
+    try:
+        sys.exit(main())
+    except KeyboardInterrupt:
+        print >> sys.stderr, 'interrupted!'
+        sys.exit(1)

es/examples/svn-long.txt

+------------------------------------------------------------------------
+r9653 | sean.hefty | 2006-09-27 14:39:55 -0700 (Wed, 27 Sep 2006) | 5 lines
+Changed paths:
+   M /gen2/trunk/src/linux-kernel/infiniband/core/cma.c
+
+On reporting a route error, also include the status for the error,
+rather than indicating a status of 0 when an error has occurred.
+
+Signed-off-by: Sean Hefty <sean.hefty@intel.com>
+
+------------------------------------------------------------------------

es/examples/svn-short.txt

+------------------------------------------------------------------------
+r9653 | sean.hefty | 2006-09-27 14:39:55 -0700 (Wed, 27 Sep 2006) | 5 lines
+
+On reporting a route error, also include the status for the error,
+rather than indicating a status of 0 when an error has occurred.
+
+Signed-off-by: Sean Hefty <sean.hefty@intel.com>
+
+------------------------------------------------------------------------

es/examples/svn.style

+header = '------------------------------------------------------------------------\n\n'
+changeset = svn.template

es/examples/svn.template

+r{rev} | {author|user} | {date|isodate} ({date|rfc822date})
+
+{desc|strip|fill76}
+
+------------------------------------------------------------------------
+#!/bin/bash
+
+#$ name: init
+
+hg init mytag
+cd mytag
+
+echo hello > myfile
+hg commit -A -m 'Initial commit'
+
+#$ name: tag
+
+hg tag v1.0
+
+#$ name: tags
+
+hg tags
+
+#$ name: log
+
+hg log
+
+#$ name: log.v1.0
+
+echo goodbye > myfile2
+hg commit -A -m 'Second commit'
+hg log -r v1.0
+
+#$ name: remove
+
+hg tag --remove v1.0
+hg tags
+
+#$ name: replace
+
+hg tag -r 1 v1.1
+hg tags
+hg tag -r 2 v1.1
+hg tag -f -r 2 v1.1
+hg tags
+
+#$ name: tip
+
+hg tip

es/examples/template.simple

+#!/bin/bash
+
+# So many different bits of random output, it would be a nightmare to
+# ignore each individually.
+#$ ignore: .*
+
+hg init myrepo
+cd myrepo
+echo hello > hello
+hg commit -Am'added hello'
+
+echo hello >> hello
+echo goodbye > goodbye
+echo '   added line to end of <<hello>> file.' > ../msg
+echo '' >> ../msg
+echo 'in addition, added a file with the helpful name (at least i hope that some might consider it so) of goodbye.' >> ../msg
+
+hg commit -Al../msg
+
+hg tag mytag
+hg tag v0.1
+
+#$ name: normal
+
+hg log -r1
+
+#$ name: compact
+
+hg log --style compact
+
+#$ name: changelog
+
+hg log --style changelog
+
+#$ name: simplest
+
+hg log -r1 --template 'i saw a changeset\n'