From patchwork Tue Dec 19 04:22:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D1717: lfs: fix committing deleted files caused by e0a1b9ee93cd From: phabricator X-Patchwork-Id: 26347 Message-Id: <56eae22673a9cf9597a2c89545ef9c27@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Tue, 19 Dec 2017 04:22:04 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHG488634db5928: lfs: fix committing deleted files caused by e0a1b9ee93cd (authored by quark, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1717?vs=4532&id=4539 REVISION DETAIL https://phab.mercurial-scm.org/D1717 AFFECTED FILES hgext/lfs/__init__.py tests/test-lfs.t CHANGE DETAILS To: quark, #hg-reviewers, mharbison72, krbullock Cc: krbullock, mercurial-devel diff --git a/tests/test-lfs.t b/tests/test-lfs.t --- a/tests/test-lfs.t +++ b/tests/test-lfs.t @@ -680,3 +680,12 @@ $ hg -R convert_lfs2 config --debug extensions | grep lfs $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob) + +Committing deleted files works: + + $ hg init $TESTTMP/repo-del + $ cd $TESTTMP/repo-del + $ echo 1 > A + $ hg commit -m 'add A' -A A + $ hg rm A + $ hg commit -m 'rm A' diff --git a/hgext/lfs/__init__.py b/hgext/lfs/__init__.py --- a/hgext/lfs/__init__.py +++ b/hgext/lfs/__init__.py @@ -124,7 +124,7 @@ if 'lfs' not in repo.requirements: ctx = repo[kwargs['node']] # TODO: is there a way to just walk the files in the commit? - if any(ctx[f].islfs() for f in ctx.files()): + if any(ctx[f].islfs() for f in ctx.files() if f in ctx): repo.requirements.add('lfs') repo._writerequirements()