equal
deleted
inserted
replaced
36 logexchange, |
36 logexchange, |
37 merge as mergemod, |
37 merge as mergemod, |
38 narrowspec, |
38 narrowspec, |
39 node, |
39 node, |
40 phases, |
40 phases, |
|
41 pycompat, |
41 repository as repositorymod, |
42 repository as repositorymod, |
42 scmutil, |
43 scmutil, |
43 sshpeer, |
44 sshpeer, |
44 statichttprepo, |
45 statichttprepo, |
45 ui as uimod, |
46 ui as uimod, |
55 # shared features |
56 # shared features |
56 sharedbookmarks = 'bookmarks' |
57 sharedbookmarks = 'bookmarks' |
57 |
58 |
58 def _local(path): |
59 def _local(path): |
59 path = util.expandpath(util.urllocalpath(path)) |
60 path = util.expandpath(util.urllocalpath(path)) |
60 return (os.path.isfile(path) and bundlerepo or localrepo) |
61 |
|
62 try: |
|
63 isfile = os.path.isfile(path) |
|
64 # Python 2 raises TypeError, Python 3 ValueError. |
|
65 except (TypeError, ValueError) as e: |
|
66 raise error.Abort(_('invalid path %s: %s') % ( |
|
67 path, pycompat.bytestr(e))) |
|
68 |
|
69 return isfile and bundlerepo or localrepo |
61 |
70 |
62 def addbranchrevs(lrepo, other, branches, revs): |
71 def addbranchrevs(lrepo, other, branches, revs): |
63 peer = other.peer() # a courtesy to callers using a localrepo for other |
72 peer = other.peer() # a courtesy to callers using a localrepo for other |
64 hashbranch, branches = branches |
73 hashbranch, branches = branches |
65 if not hashbranch and not branches: |
74 if not hashbranch and not branches: |