Bug 3909 - hg update in central database fails with chmod in lfutil.py
Summary: hg update in central database fails with chmod in lfutil.py
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: largefiles (show other bugs)
Version: earlier
Hardware: PC Linux
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-25 13:48 UTC by andersbk
Modified: 2017-11-01 18:05 UTC (History)
4 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andersbk 2013-04-25 13:48 UTC
Largefiles not owned by push user fail update in main, parent, central, repository.

Main repo has:
[hooks]
changegroup = hg update

User commits and pushes updates.

Changegroup fails on any hglf file not owned by pusher.

lfutil.py code has os.chmod. Fix may be similar to fix done for normal files?
See http://bz.selenic.com/show_bug.cgi?id=530

Failure traceback:

$ hg --debug --verbose --traceback update
Traceback (most recent call last):
  File "/tools/APPS/mercurial-2.5.4/lib/python/mercurial/dispatch.py", line 88, in _runcatch
    return _dispatch(req)
  File "/tools/APPS/mercurial-2.5.4/lib/python/mercurial/dispatch.py", line 743, in _dispatch
    cmdpats, cmdoptions)
  File "/tools/APPS/mercurial-2.5.4/lib/python/mercurial/dispatch.py", line 514, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/tools/APPS/mercurial-2.5.4/lib/python/mercurial/extensions.py", line 189, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/tools/APPS/mercurial-2.5.4/lib/python/hgext/pager.py", line 130, in pagecmd
    return orig(ui, options, cmd, cmdfunc)
  File "/tools/APPS/mercurial-2.5.4/lib/python/mercurial/extensions.py", line 189, in wrap
    return wrapper(origfn, *args, **kwargs)
  File "/tools/APPS/mercurial-2.5.4/lib/python/hgext/color.py", line 394, in colorcmd
    return orig(ui_, opts, cmd, cmdfunc)
  File "/tools/APPS/mercurial-2.5.4/lib/python/mercurial/dispatch.py", line 833, in _runcommand
    return checkargs()
  File "/tools/APPS/mercurial-2.5.4/lib/python/mercurial/dispatch.py", line 804, in checkargs
    return cmdfunc()
  File "/tools/APPS/mercurial-2.5.4/lib/python/mercurial/dispatch.py", line 740, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/tools/APPS/mercurial-2.5.4/lib/python/mercurial/util.py", line 475, in check
    return func(*args, **kwargs)
  File "/tools/APPS/mercurial-2.5.4/lib/python/mercurial/extensions.py", line 144, in wrap
    util.checksignature(origfn), *args, **kwargs)
  File "/tools/APPS/mercurial-2.5.4/lib/python/mercurial/util.py", line 475, in check
    return func(*args, **kwargs)
  File "/tools/APPS/mercurial-2.5.4/lib/python/hgext/largefiles/overrides.py", line 317, in overrideupdate
    lfutil.updatestandin(repo, lfutil.standin(lfile))
  File "/tools/APPS/mercurial-2.5.4/lib/python/hgext/largefiles/lfutil.py", line 280, in updatestandin
    writestandin(repo, standin, hash, executable)
  File "/tools/APPS/mercurial-2.5.4/lib/python/hgext/largefiles/lfutil.py", line 289, in writestandin
    writehash(hash, repo.wjoin(standin), executable)
  File "/tools/APPS/mercurial-2.5.4/lib/python/hgext/largefiles/lfutil.py", line 348, in writehash
    os.chmod(filename, getmode(executable))
OSError: [Errno 1] Operation not permitted: '/data/project/.hglf/code/file_that_is_large'
abort: Operation not permitted: '/data/project/.hglf/code/file_that_is_large'
Comment 1 Matt Mackall 2013-04-25 14:16 UTC
Probably ought to use repo.wwrite. This code path will eventually need either a repo or vfs object anyway.
Comment 2 HG Bot 2013-04-27 13:45 UTC
Fixed by http://selenic.com/repo/hg/rev/0509ae083ec1
Mads Kiilerich <madski@unity3d.com>
largefiles: use repo.wwrite for writing standins (issue3909)

(please test the fix)
Comment 3 andersbk 2013-05-08 15:36 UTC
(In reply to comment #2)
Applied patch and am using in a live repository.


Working so far so good.
Comment 4 Matt Mackall 2013-05-08 16:39 UTC
This fix was released in 2.6. Marking resolved.