Patchwork D5860: scmutil: delete now-unused origpath() (API)

login
register
mail settings
Submitter phabricator
Date Feb. 7, 2019, midnight
Message ID <999628ea4eeeeb7caf3c309fb15a7872@localhost.localdomain>
Download mbox | patch
Permalink /patch/38494/
State Not Applicable
Headers show

Comments

phabricator - Feb. 7, 2019, midnight
martinvonz updated this revision to Diff 13865.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5860?vs=13824&id=13865

REVISION DETAIL
  https://phab.mercurial-scm.org/D5860

AFFECTED FILES
  mercurial/scmutil.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: pulkit, mercurial-devel

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -873,41 +873,6 @@ 
 
     return origvfs.join(filepath)
 
-def origpath(ui, repo, filepath):
-    '''customize where .orig files are created
-
-    Fetch user defined path from config file: [ui] origbackuppath = <path>
-    Fall back to default (filepath with .orig suffix) if not specified
-    '''
-    origvfs = getorigvfs(ui, repo)
-    if origvfs is None:
-        return filepath + ".orig"
-
-    # Convert filepath from an absolute path into a path inside the repo.
-    filepathfromroot = util.normpath(os.path.relpath(filepath,
-                                                     start=repo.root))
-
-    origbackupdir = origvfs.dirname(filepathfromroot)
-    if not origvfs.isdir(origbackupdir) or origvfs.islink(origbackupdir):
-        ui.note(_('creating directory: %s\n') % origvfs.join(origbackupdir))
-
-        # Remove any files that conflict with the backup file's path
-        for f in reversed(list(util.finddirs(filepathfromroot))):
-            if origvfs.isfileorlink(f):
-                ui.note(_('removing conflicting file: %s\n')
-                        % origvfs.join(f))
-                origvfs.unlink(f)
-                break
-
-        origvfs.makedirs(origbackupdir)
-
-    if origvfs.isdir(filepathfromroot) and not origvfs.islink(filepathfromroot):
-        ui.note(_('removing conflicting directory: %s\n')
-                % origvfs.join(filepathfromroot))
-        origvfs.rmtree(filepathfromroot, forcibly=True)
-
-    return origvfs.join(filepathfromroot)
-
 class _containsnode(object):
     """proxy __contains__(node) to container.__contains__ which accepts revs"""