`moz-phab` incorrectly uploads symlinks as text files when using Mercurial
Categories
(Conduit :: moz-phab, defect, P3)
Tracking
(Not tracked)
People
(Reporter: sheehan, Assigned: sheehan)
References
Details
Attachments
(1 file)
moz-phab version (from moz-phab --version): 1.5.1
Python version (from python3 --version): 3.12.3
OS: Linux
While testing bug 1895762 (which adds a symlink-reject check to Lando) on Lando-dev, I noticed my patch uploaded to Phabricator with moz-phab which includes a symlink didn't trigger the symlink reject check. When I went to https://phabricator-dev.allizom.org/conduit/method/differential.getrawdiff/ and used 5760 as the diffID, I can see the patch contents look like this:
diff --git a/blahfile_symlink b/blahfile_symlink
new file mode 100644
--- /dev/null
+++ b/blahfile_symlink
@@ -0,0 +1 @@
+/home/sheehan/blahfile
\ No newline at end of file
You can see the file mode is 100644, like a regular file on disk with the content of the file as the path the symlink points to. On my local machine the diff looks like:
diff --git a/blahfile_symlink b/blahfile_symlink
new file mode 120000
--- /dev/null
+++ b/blahfile_symlink
@@ -0,0 +1,1 @@
+/home/sheehan/blahfile
\ No newline at end of file
Where the file mode is 120000, representing a symlink.
| Assignee | ||
Comment 1•2 years ago
|
||
This looks to be happening as a result of this logic, and appears to be Mercurial-specific. I have yet to determine if Git would have the same problem, and it's likely this is a difference in behaviour between the two systems.
| Assignee | ||
Updated•23 days ago
|
| Assignee | ||
Comment 2•23 days ago
|
||
hg files -T {flags} reports l for a symlink, which fell through to the
regular-file mode and made Phabricator treat the symlink as a text file.
| Assignee | ||
Updated•23 days ago
|
Comment 3•22 days ago
|
||
Authored by https://github.com/cgsheeh
https://github.com/mozilla-conduit/review/commit/4886f8413d7af4826ab858ba25f451bad36471d3
[main] mercurial: submit symlinks with the 120000 file mode (Bug 1898339) r=shtrom
Description
•