mozpack support for removing untracked files

RESOLVED FIXED in mozilla24

Status

()

Core
Build Config
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: gps, Assigned: gps)

Tracking

Trunk
mozilla24
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
I'm splitting off the mozpack work from bug 850380.

Essentially we want code in mozpack to remove "untracked" files from a directory. Essentially, the build system will be able to say "only these files should exist" and this code will purge files that don't belong. This is very similar to how version control systems clean or purge the working directory.
(Assignee)

Comment 1

4 years ago
Created attachment 764424 [details] [diff] [review]
Support for removing untracked files from a directory

Since the XPIDL patch, I renamed DirectoryPruner to FilePurger and added a
class to hold the results of the operation. That class is still minimal.
It can expand as needed.
Attachment #764424 - Flags: review?(mh+mozilla)
(Assignee)

Updated

4 years ago
Assignee: nobody → gps
(Assignee)

Updated

4 years ago
Blocks: 884587
Comment on attachment 764424 [details] [diff] [review]
Support for removing untracked files from a directory

Review of attachment 764424 [details] [diff] [review]:
-----------------------------------------------------------------

::: python/mozbuild/mozpack/copier.py
@@ +202,5 @@
> +        return FileCopier.add(self, path, FilePurger.FakeFile())
> +
> +    def purge(self, dest):
> +        """Deletes all files and empty directories not in the registry."""
> +        return FileCopier.copy(self, dest)

Not sure how to do that properly in python, but you may want to make FilePurger.copy not do anything.

::: python/mozbuild/mozpack/test/test_copier.py
@@ +136,5 @@
> +    def setUp(self):
> +        self.tmpdir = mkdtemp()
> +
> +    def tearDown(self):
> +        shutil.rmtree(self.tmpdir)

You can import TestWithTmpDir from test_files.
Attachment #764424 - Flags: review?(mh+mozilla) → review+
(Assignee)

Comment 3

4 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/ba0b09e110ee

Comment 4

4 years ago
https://hg.mozilla.org/mozilla-central/rev/ba0b09e110ee
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.