⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 194415 in webkit


Ignore:
Timestamp:
Dec 24, 2015, 2:42:53 AM (11 years ago)
Author:
youenn.fablet@crf.canon.fr
Message:

Python SCM should be able to retrieve untracked files - Generic changes
https://bugs.webkit.org/show_bug.cgi?id=152536

Reviewed by Brent Fulgham.

This patch introduces SCM.untracked_files to retrieve a list of untracked files.
No support is yet added to GIT and SVN specific implementations.

  • Scripts/webkitpy/common/checkout/scm/scm.py:

(SCM.untracked_files):

  • Scripts/webkitpy/common/checkout/scm/scm_unittest.py:

(SCMTest._shared_test_untracked_files):

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r194406 r194415  
     12015-12-24  Youenn Fablet  <youenn.fablet@crf.canon.fr>
     2
     3        Python SCM should be able to retrieve untracked files - Generic changes
     4        https://bugs.webkit.org/show_bug.cgi?id=152536
     5
     6        Reviewed by Brent Fulgham.
     7
     8        This patch introduces SCM.untracked_files to retrieve a list of untracked files.
     9        No support is yet added to GIT and SVN specific implementations.
     10
     11        * Scripts/webkitpy/common/checkout/scm/scm.py:
     12        (SCM.untracked_files):
     13        * Scripts/webkitpy/common/checkout/scm/scm_unittest.py:
     14        (SCMTest._shared_test_untracked_files):
     15
    1162015-12-23  Dewei Zhu  <dewei_zhu@apple.com>
    217
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm.py

    r188481 r194415  
    205205        self._subclass_must_implement()
    206206
     207    def untracked_files(self, include_ignored_files=False):
     208        self._subclass_must_implement()
     209
    207210    def discard_working_directory_changes(self):
    208211        self._subclass_must_implement()
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py

    r186870 r194415  
    310310        os.chdir(old_cwd)
    311311
     312    def _shared_test_untracked_files(self, scm):
     313        write_into_file_at_path("test_file_new", "new content")
     314        self.assertItemsEqual(scm.untracked_files(), ["test_file_new"])
     315
     316        os.mkdir("test_dir_new")
     317        write_into_file_at_path(os.path.join("test_dir_new", "test_file_new"), "new stuff")
     318        self.assertItemsEqual(scm.untracked_files(), ["test_dir_new", "test_file_new"])
     319
     320        old_cwd = os.getcwd()
     321        os.chdir("test_dir_new")
     322        # Validate that untracked_files do not change with our cwd.
     323        self.assertItemsEqual(scm.untracked_files(), ["test_dir_new", "test_file_new"])
     324
     325        os.chdir(old_cwd)
     326
     327        write_into_file_at_path("test_file_new.pyc", "new ignored file")
     328        self.assertItemsEqual(scm.untracked_files(), ["test_dir_new", "test_file_new"])
     329        self.assertItemsEqual(scm.untracked_files(include_ignored_files=True), ["test_file_new.pyc", "test_dir_new", "test_file_new"])
     330
     331        shutil.rmtree("test_dir_new")
     332        os.remove("test_file_new")
     333        os.remove("test_file_new.pyc")
     334
    312335    def _shared_test_added_files(self):
    313336        write_into_file_at_path("test_file", "changed content")
Note: See TracChangeset for help on using the changeset viewer.