mercurial/hg.py
branchstable
changeset 14825 de9eb6b1da4f
parent 14737 b39ed8c8e5e5
child 14839 510c893a726f
equal deleted inserted replaced
14824:7698c275aa56 14825:de9eb6b1da4f
    15 import merge as mergemod
    15 import merge as mergemod
    16 import verify as verifymod
    16 import verify as verifymod
    17 import errno, os, shutil
    17 import errno, os, shutil
    18 
    18 
    19 def _local(path):
    19 def _local(path):
    20     path = util.expandpath(util.localpath(path))
    20     path = util.expandpath(util.urllocalpath(path))
    21     return (os.path.isfile(path) and bundlerepo or localrepo)
    21     return (os.path.isfile(path) and bundlerepo or localrepo)
    22 
    22 
    23 def addbranchrevs(lrepo, repo, branches, revs):
    23 def addbranchrevs(lrepo, repo, branches, revs):
    24     hashbranch, branches = branches
    24     hashbranch, branches = branches
    25     if not hashbranch and not branches:
    25     if not hashbranch and not branches:
   225         dest = defaultdest(source)
   225         dest = defaultdest(source)
   226         ui.status(_("destination directory: %s\n") % dest)
   226         ui.status(_("destination directory: %s\n") % dest)
   227     else:
   227     else:
   228         dest = ui.expandpath(dest)
   228         dest = ui.expandpath(dest)
   229 
   229 
   230     dest = util.localpath(dest)
   230     dest = util.urllocalpath(dest)
   231     source = util.localpath(source)
   231     source = util.urllocalpath(source)
   232 
   232 
   233     if os.path.exists(dest):
   233     if os.path.exists(dest):
   234         if not os.path.isdir(dest):
   234         if not os.path.isdir(dest):
   235             raise util.Abort(_("destination '%s' already exists") % dest)
   235             raise util.Abort(_("destination '%s' already exists") % dest)
   236         elif os.listdir(dest):
   236         elif os.listdir(dest):
   248 
   248 
   249     srclock = destlock = dircleanup = None
   249     srclock = destlock = dircleanup = None
   250     try:
   250     try:
   251         abspath = origsource
   251         abspath = origsource
   252         if islocal(origsource):
   252         if islocal(origsource):
   253             abspath = os.path.abspath(util.localpath(origsource))
   253             abspath = os.path.abspath(util.urllocalpath(origsource))
   254 
   254 
   255         if islocal(dest):
   255         if islocal(dest):
   256             dircleanup = DirCleanup(dest)
   256             dircleanup = DirCleanup(dest)
   257 
   257 
   258         copy = False
   258         copy = False