Bug 1006457

Summary: Mercurial doesn't add broken symlink when using "copy -A"
Product: Red Hat Enterprise Linux 6 Reporter: Dave Johansen <davejohansen>
Component: mercurialAssignee: Petr Stodulka <pstodulk>
Status: CLOSED ERRATA QA Contact: Leos Pol <lpol>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4CC: lpol, ovasik, tlavigne
Target Milestone: rcKeywords: EasyFix, Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: mercurial-1.4-4.el6 Doc Type: Bug Fix
Doc Text:
Prior to this update, running the "hg copy -A" command did not add broken symbolic links to a repository. The underlying source code has been modified to use the os.patch.lexists() method. As a result, "hg copy -A" adds the broken symbolic links as expected.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-22 07:45:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Source rpm of Mercurial 1.4.3 with patch to fix the broken symbolic link issue
none
copy patch none

Description Dave Johansen 2013-09-10 16:07:39 UTC
Description of problem:
Broken symbolic links are not added like they should be when "copy -A" is used.

Version-Release number of selected component (if applicable):
1.4

How reproducible:
Always

Steps to Reproduce:
mkdir dir
touch dir/file.txt
cd dir
ln -s file.txt link_valid.txt
ln -s nothing.txt link_invalid.txt
cd ..
hg init
hg add dir
hg ci -m "Initial checkin"
mv dir moved
hg copy -A dir/file.txt moved/file.txt
hg copy -A dir/link_valid.txt moved/link_valid.txt
hg remove dir/file.txt
hg remove dir/link_valid.txt
hg copy -A dir/link_invalid.txt moved/link_invalid.txt
hg remove dir/link_invalid.txt
hg stat

Actual results:
moved/link_invalid.txt is not added to the repository.

Expected results:
moved/link_invalid.txt should be added to the repository.

Comment 2 Dave Johansen 2013-09-11 15:31:49 UTC
I noticed that version 1.4.3 of Mercurial is available, so I tested to see if the issue was fixed in that version, but it is not.

Also, potentially worth noting is that I did the above test on RHEL 5 (which uses Mercurial 1.3.1) and the same issue exists there as well.

Comment 3 Dave Johansen 2013-09-13 15:24:11 UTC
Created attachment 797388 [details]
Source rpm of Mercurial 1.4.3 with patch to fix the broken symbolic link issue

The fix that this patch is taken from can be found at:
http://www.selenic.com/hg/rev/70236d6fd844

I also noticed that Mercurial 1.4.3 is available, so I tested this patch applied to that updated source and it resolves the issue.

Comment 4 RHEL Program Management 2013-10-13 23:11:05 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 5 Dave Johansen 2013-10-25 04:26:32 UTC
This is still an issue and I'd like to request that it be considered that the fix be included in the next release.

Comment 6 Petr Stodulka 2014-11-07 09:57:39 UTC
Created attachment 954862 [details]
copy patch

Comment 10 errata-xmlrpc 2015-07-22 07:45:42 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-1436.html