Bug 1006457 - Mercurial doesn't add broken symlink when using "copy -A"
Summary: Mercurial doesn't add broken symlink when using "copy -A"
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: mercurial
Version: 6.4
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Petr Stodulka
QA Contact: Leos Pol
Depends On:
TreeView+ depends on / blocked
Reported: 2013-09-10 16:07 UTC by Dave Johansen
Modified: 2015-07-22 07:45 UTC (History)
3 users (show)

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.
Clone Of:
Last Closed: 2015-07-22 07:45:42 UTC
Target Upstream Version:

Attachments (Terms of Use)
Source rpm of Mercurial 1.4.3 with patch to fix the broken symbolic link issue (1.85 MB, application/x-rpm)
2013-09-13 15:24 UTC, Dave Johansen
no flags Details
copy patch (508 bytes, patch)
2014-11-07 09:57 UTC, Petr Stodulka
no flags Details | Diff

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:1436 0 normal SHIPPED_LIVE mercurial bug fix update 2015-07-20 18:05:56 UTC

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):

How reproducible:

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:

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.


Note You need to log in before you can comment on or make changes to this bug.