Mercurial > public > mercurial-scm > hg
comparison mercurial/scmutil.py @ 42711:53c07f08fea1
changectx: extract explicit computechangesetfilesremoved method from context
Right now, the logic around changeset centric removed files data are buried into
the "changectx" code. We extract this code in a dedicated method (in the scmutil
module) for clarity. This clarity will help to explicitly compute and caches
these data in the future.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 12 Jun 2019 13:42:52 +0100 |
parents | 87c4cd89b539 |
children | 38392d5bde8e |
comparison
equal
deleted
inserted
replaced
42710:87c4cd89b539 | 42711:53c07f08fea1 |
---|---|
1991 added = [] | 1991 added = [] |
1992 for f in ctx.files(): | 1992 for f in ctx.files(): |
1993 if not any(f in p for p in ctx.parents()): | 1993 if not any(f in p for p in ctx.parents()): |
1994 added.append(f) | 1994 added.append(f) |
1995 return added | 1995 return added |
1996 | |
1997 def computechangesetfilesremoved(ctx): | |
1998 """return the list of files removed in a changeset | |
1999 """ | |
2000 removed = [] | |
2001 for f in ctx.files(): | |
2002 if f not in ctx: | |
2003 removed.append(f) | |
2004 return removed |