Patchwork D8461: rust-status: check for '.hg' regardless of file type (issue6300)

login
register
mail settings
Submitter phabricator
Date April 20, 2020, 9:22 a.m.
Message ID <differential-rev-PHID-DREV-6e5top2eh4uszjxpkfta-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46191/
State Superseded
Headers show

Comments

phabricator - April 20, 2020, 9:22 a.m.
Alphare created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  '.hg' would show up in `hg status` if were a symlink.

REPOSITORY
  rHG Mercurial

BRANCH
  stable

REVISION DETAIL
  https://phab.mercurial-scm.org/D8461

AFFECTED FILES
  rust/hg-core/src/dirstate/status.rs

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-devel
phabricator - April 22, 2020, 4:19 p.m.
This revision now requires changes to proceed.
marmoute added a comment.
marmoute requested changes to this revision.


  Actually, please fold the next patch in this one.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8461/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8461

To: Alphare, #hg-reviewers, marmoute
Cc: mercurial-patches, mercurial-devel
phabricator - April 23, 2020, 8:04 a.m.
Alphare added a comment.


  In D8461#126482 <https://phab.mercurial-scm.org/D8461#126482>, @marmoute wrote:
  
  > Actually, please fold the next patch in this one.
  
  Done.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8461/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8461

To: Alphare, #hg-reviewers, marmoute
Cc: mercurial-patches, mercurial-devel
phabricator - April 23, 2020, 8:46 a.m.
marmoute added a comment.
marmoute accepted this revision.


  thanks

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8461/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8461

To: Alphare, #hg-reviewers, marmoute
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/rust/hg-core/src/dirstate/status.rs b/rust/hg-core/src/dirstate/status.rs
--- a/rust/hg-core/src/dirstate/status.rs
+++ b/rust/hg-core/src/dirstate/status.rs
@@ -323,6 +323,11 @@ 
     let file_type = dir_entry.file_type()?;
     let entry_option = dmap.get(&filename);
 
+    if filename.as_bytes() == b".hg" {
+        // Could be a directory or a symlink
+        return Ok(());
+    }
+
     if file_type.is_dir() {
         handle_traversed_dir(
             scope,
@@ -446,9 +451,7 @@ 
     options: StatusOptions,
 ) -> IoResult<()> {
     let directory = directory.as_ref();
-    if directory.as_bytes() == b".hg" {
-        return Ok(());
-    }
+
     let visit_entries = match matcher.visit_children_set(directory) {
         VisitChildrenSet::Empty => return Ok(()),
         VisitChildrenSet::This | VisitChildrenSet::Recursive => None,