diff --git a/hgext/largefiles/proto.py b/hgext/largefiles/proto.py index e462313ef1bd5a4aff601c4637580371553176ba_aGdleHQvbGFyZ2VmaWxlcy9wcm90by5weQ==..5516fdf3fe2483a157d7220beff22fa28934565b_aGdleHQvbGFyZ2VmaWxlcy9wcm90by5weQ== 100644 --- a/hgext/largefiles/proto.py +++ b/hgext/largefiles/proto.py @@ -20,8 +20,10 @@ user cache.''' proto.redirect() - tmpfp = util.atomictempfile(lfutil.storepath(repo, sha), - createmode=repo.store.createmode) + path = lfutil.storepath(repo, sha) + util.makedirs(os.path.dirname(path)) + tmpfp = util.atomictempfile(path, createmode=repo.store.createmode) + try: try: proto.getfile(tmpfp) diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t index e462313ef1bd5a4aff601c4637580371553176ba_dGVzdHMvdGVzdC1sYXJnZWZpbGVzLnQ=..5516fdf3fe2483a157d7220beff22fa28934565b_dGVzdHMvdGVzdC1sYXJnZWZpbGVzLnQ= 100644 --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -952,6 +952,31 @@ [255] $ rm -rf empty +Push a largefiles repository to a served empty repository + $ hg init r8 + $ echo c3 > r8/f1 + $ hg add --large r8/f1 -R r8 + $ hg commit -m "m1" -R r8 + Invoking status precommit hook + A f1 + $ hg init empty + $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \ + > --config 'web.allow_push=*' --config web.push_ssl=False + $ cat hg.pid >> $DAEMON_PIDS + $ rm ${USERCACHE}/* + $ hg push -R r8 http://localhost:$HGPORT2 + pushing to http://localhost:$HGPORT2/ + searching for changes + searching for changes + remote: adding changesets + remote: adding manifests + remote: adding file changes + remote: added 1 changesets with 1 changes to 1 files + $ rm -rf empty + +used all HGPORTs, kill all daemons + $ "$TESTDIR/killdaemons.py" + Clone a local repository owned by another user We have to simulate that here by setting $HOME and removing write permissions $ ORIGHOME="$HOME"