[PATCH 2 of 3] commands: add examples for 'addremove'

Mathias De Maré mathias.demare at gmail.com
Wed Nov 25 13:44:52 CST 2015


# HG changeset patch
# User Mathias De Maré <mathias.demare at gmail.com>
# Date 1448471459 -3600
#      Wed Nov 25 18:10:59 2015 +0100
# Node ID 6f2fbb0e85a3666561a10ccd1f8eb3b7e76ceda3
# Parent  1c6ef9675a267afecc90657bda0463a750c9bfd9
commands: add examples for 'addremove'

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -248,6 +248,46 @@
     not specified, -s/--similarity defaults to 100 and only renames of
     identical files are detected.
 
+    .. container:: verbose
+
+       Examples:
+
+         - A number of files (bar.c and foo.c) are new,
+           while foobar.c has been removed (without using :hg:`remove`)
+           from the repository::
+
+             $ ls
+             bar.c foo.c
+             $ hg status
+             ! foobar.c
+             ? bar.c
+             ? foo.c
+             $ hg addremove
+             adding bar.c
+             adding foo.c
+             removing foobar.c
+             $ hg status
+             A bar.c
+             A foo.c
+             R foobar.c
+
+         - A file foobar.c was moved to foo.c without using :hg:`rename`.
+           Afterwards, it was edited slightly::
+
+             $ ls
+             foo.c
+             $ hg status
+             ! foobar.c
+             ? foo.c
+             $ hg addremove --similarity 90
+             removing foobar.c
+             adding foo.c
+             recording removal of foobar.c as rename to foo.c (94% similar)
+             $ hg status -C
+             A foo.c
+               foobar.c
+             R foobar.c
+
     Returns 0 if all files are successfully added.
     """
     try:


More information about the Mercurial-devel mailing list