[PATCH 1 of 5] copies: return consistent type from revinfo

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Dec 2 11:28:16 UTC 2019


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at octobus.net>
# Date 1573673602 -3600
#      Wed Nov 13 20:33:22 2019 +0100
# Node ID 79af3064c0b820d4339e595eb89d40e930eeadfd
# Parent  aef7b91dba51b5f3fad8cf675e0b51b35d0fd5bb
# EXP-Topic patch-copies-rust-prep
# Available At https://dev.heptapod.net/octobus/mercurial-devel/
#              hg pull https://dev.heptapod.net/octobus/mercurial-devel/ -r 79af3064c0b8
copies: return consistent type from revinfo

The return is expected to be a list, so we should return a list. This make the
use of this function from type-checked language (eg: rust) much simpler.

diff --git a/mercurial/copies.py b/mercurial/copies.py
--- a/mercurial/copies.py
+++ b/mercurial/copies.py
@@ -231,7 +231,7 @@ def _revinfogetter(repo):
             else:
                 p1copies = {}
                 p2copies = {}
-                removed = ()
+                removed = []
             return p1, p2, p1copies, p2copies, removed
 
     else:


More information about the Mercurial-devel mailing list