[PATCH 1 of 2] lfs: avoid an improper usage of os.path.basename() to parse a URI

Matt Harbison mharbison72 at gmail.com
Sun Apr 1 04:00:54 UTC 2018


# HG changeset patch
# User Matt Harbison <matt_harbison at yahoo.com>
# Date 1522554476 14400
#      Sat Mar 31 23:47:56 2018 -0400
# Node ID bdef5a344ebfd54cf454b184e14d0c37400f7547
# Parent  2ed180117f7658d0cbf6a1ece20944465c55c947
lfs: avoid an improper usage of os.path.basename() to parse a URI

diff --git a/hgext/lfs/wireprotolfsserver.py b/hgext/lfs/wireprotolfsserver.py
--- a/hgext/lfs/wireprotolfsserver.py
+++ b/hgext/lfs/wireprotolfsserver.py
@@ -10,7 +10,6 @@ from __future__ import absolute_import
 import datetime
 import errno
 import json
-import os
 
 from mercurial.hgweb import (
     common as hgwebcommon,
@@ -239,7 +238,7 @@ def _processbasictransfer(repo, req, res
     """
 
     method = req.method
-    oid = os.path.basename(req.dispatchpath)
+    oid = req.dispatchparts[-1]
     localstore = repo.svfs.lfslocalblobstore
 
     if method == b'PUT':


More information about the Mercurial-devel mailing list