[issue2061] exception when cloning (or updating) from a repo with really corrupted symlinks

Thomas Langer bugs at mercurial.selenic.com
Wed Feb 24 09:33:47 CST 2010


New submission from Thomas Langer <thomas.langer at lantiq.com>:

The initial problem was a commit of symbolic links from windows in a working
repo created on linux and accessed via CIFS/SMB.
(This problem is already described in Issue 1888!)

Most of the links were pointing to text files, where the content where used
as symlink target (creating an invalid link or aborting with "File name too
long")
This is part 1 of the bug.
If possible, do a check for valid file names and allow an update with
ignoring this problem.

The second part is more critical, as it provokes an exception:
One of the links were pointing to a binary file and using the file content
as target of the symbolic link was resulting in an exception in the python
code. This is more critical, because of the exception no indication to the
corrupted file/symlink is printed, which might help to fix the issue (by
committing changes to a local repo and merging)

Log of the exception:

pulling subrepo drivers
requesting all changes
adding changesets
adding manifests
adding file changes
added 16 changesets with 272 changes to 185 files
** unknown exception encountered, details follow
** report bug details to http://mercurial.selenic.com/bts/
** or mercurial at selenic.com
** Mercurial Distributed SCM (version 1.4.3)
** Extensions loaded:
Traceback (most recent call last):
  File "/opt/mercurial_1.4/mercurial_1.4.3/bin/hg", line 27, in <module>
    mercurial.dispatch.run()
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/dispatch.py",
line 16, in run
    sys.exit(dispatch(sys.argv[1:]))
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/dispatch.py",
line 30, in dispatch
    return _runcatch(u, args)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/dispatch.py",
line 46, in _runcatch
    return _dispatch(ui, args)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/dispatch.py",
line 454, in _dispatch
    return runcommand(lui, repo, cmd, fullargs, ui, options, d)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/dispatch.py",
line 324, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/dispatch.py",
line 505, in _runcommand
    return checkargs()
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/dispatch.py",
line 459, in checkargs
    return cmdfunc()
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/dispatch.py",
line 453, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/util.py",
line 386, in check
    return func(*args, **kwargs)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/commands.py",
line 649, in clone
    update=opts.get('updaterev') or not opts.get('noupdate'))
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/hg.py",
line 325, in clone
    _update(dest_repo, uprev)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/hg.py",
line 339, in update
    stats = _merge.update(repo, node, False, False, None)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/merge.py",
line 501, in update
    stats = applyupdates(repo, action, wc, p2)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/merge.py",
line 318, in applyupdates
    subrepo.submerge(repo, wctx, mctx, wctx)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/subrepo.py",
line 108, in submerge
    wctx.sub(s).get(r)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/subrepo.py",
line 206, in get
    hg.clean(self._repo, revision, False)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/hg.py",
line 350, in clean
    stats = _merge.update(repo, node, False, True, None)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/merge.py",
line 501, in update
    stats = applyupdates(repo, action, wc, p2)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/merge.py",
line 315, in applyupdates
    repo.wwrite(f, t, flags)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/localrepo.py",
line 543, in wwrite
    self.wopener.symlink(data, filename)
  File
"/opt/mercurial_1.4/mercurial_1.4.3/linux30_64/lib/python2.6/site-packages/mercurial/util.py",
line 847, in symlink
    os.symlink(src, linkname)
TypeError: symlink() argument 1 must be encoded string without NULL bytes,
not str

----------
messages: 11877
nosy: thlanger
priority: urgent
status: unread
title: exception when cloning (or updating) from a repo with really corrupted symlinks
topic: 1.4, clone, symlinks

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2061>
____________________________________________________


More information about the Mercurial-devel mailing list