D7377: commands: log --line-range is incompatible with --copies

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Nov 14 03:52:22 UTC 2019


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This was (to my surprise) detected by pytype.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D7377

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4716,6 +4716,9 @@
         raise error.Abort(
             _(b'FILE arguments are not compatible with --line-range option')
         )
+    copies = opts.get(b'copies')
+    if linerange and copies:
+        raise error.Abort(_(b'--line-range is incompatible with --copies'))
 
     repo = scmutil.unhidehashlikerevs(repo, opts.get(b'rev'), b'nowarn')
     revs, differ = logcmdutil.getrevs(repo, pats, opts)
@@ -4725,7 +4728,7 @@
         revs, differ = logcmdutil.getlinerangerevs(repo, revs, opts)
 
     getcopies = None
-    if opts.get(b'copies'):
+    if copies:
         endrev = None
         if revs:
             endrev = revs.max() + 1



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list