Patchwork [4,of,6,V2] update: clarify that -C and -c are mutually exclusive

login
register
mail settings
Submitter via Mercurial-devel
Date Feb. 14, 2017, 11:08 p.m.
Message ID <f9b2552610a5453bf836.1487113719@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/18499/
State Accepted
Headers show

Comments

via Mercurial-devel - Feb. 14, 2017, 11:08 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1487027086 28800
#      Mon Feb 13 15:04:46 2017 -0800
# Node ID f9b2552610a5453bf836d3c7469fbebc59c5ad4b
# Parent  8a7b145ee159628a0ab5926ef5e4354df3f05ee0
update: clarify that -C and -c are mutually exclusive

This makes it clear in both the synopsis and in the verbose output
that -C and -c are mutually exclusive. It also restructures the
verbose output a little so it's better prepared for a third option
(--merge).

This patch also reorders the options to match the flag table.
Yuya Nishihara - Feb. 15, 2017, 1:40 p.m.
On Tue, 14 Feb 2017 15:08:39 -0800, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1487027086 28800
> #      Mon Feb 13 15:04:46 2017 -0800
> # Node ID f9b2552610a5453bf836d3c7469fbebc59c5ad4b
> # Parent  8a7b145ee159628a0ab5926ef5e4354df3f05ee0
> update: clarify that -C and -c are mutually exclusive

These look good refactoring. Queued up to this, thanks.

Patch

diff -r 8a7b145ee159 -r f9b2552610a5 mercurial/commands.py
--- a/mercurial/commands.py	Mon Feb 13 11:58:02 2017 -0800
+++ b/mercurial/commands.py	Mon Feb 13 15:04:46 2017 -0800
@@ -5916,7 +5916,7 @@ 
     ('d', 'date', '', _('tipmost revision matching date'), _('DATE')),
     ('r', 'rev', '', _('revision'), _('REV'))
      ] + mergetoolopts,
-    _('[-c] [-C] [-d DATE] [[-r] REV]'))
+    _('[-C|-c] [-d DATE] [[-r] REV]'))
 def update(ui, repo, node=None, rev=None, clean=False, date=None, check=False,
            tool=None):
     """update working directory (or switch revisions)
@@ -5937,10 +5937,11 @@ 
 
     .. container:: verbose
 
-      The following rules apply when the working directory contains
-      uncommitted changes:
-
-      1. If neither -c/--check nor -C/--clean is specified, and if
+      The -C/--clean and -c/--check options control what happens if the
+      working directory contains uncommitted changes.
+      At most of one of them can be specified.
+
+      1. If no option is specified, and if
          the requested changeset is an ancestor or descendant of
          the working directory's parent, the uncommitted changes
          are merged into the requested changeset and the merged