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

login
register
mail settings
Submitter Pierre-Yves David
Date Dec. 2, 2019, 11:28 a.m.
Message ID <79af3064c0b820d4339e.1575286096@nodosa.octobus.net>
Download mbox | patch
Permalink /patch/43560/
State Accepted
Headers show

Comments

Pierre-Yves David - Dec. 2, 2019, 11:28 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@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.
Yuya Nishihara - Dec. 2, 2019, 1:05 p.m.
On Mon, 02 Dec 2019 12:28:16 +0100, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@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

Queued the series, thanks.

Patch

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: