Show More
@@ -9,7 +9,7 b' from node import *' | |||||
9 | from i18n import _ |
|
9 | from i18n import _ | |
10 | import os, sys, mdiff, bdiff, util, templater, patch, commands |
|
10 | import os, sys, mdiff, bdiff, util, templater, patch, commands | |
11 | import atexit, signal, pdb, hg, lock, fancyopts, traceback |
|
11 | import atexit, signal, pdb, hg, lock, fancyopts, traceback | |
12 |
import socket, revlog, version, extensions, errno |
|
12 | import socket, revlog, version, extensions, errno | |
13 |
|
13 | |||
14 | revrangesep = ':' |
|
14 | revrangesep = ':' | |
15 |
|
15 | |||
@@ -186,6 +186,15 b' def findcmd(ui, cmd):' | |||||
186 |
|
186 | |||
187 | raise UnknownCommand(cmd) |
|
187 | raise UnknownCommand(cmd) | |
188 |
|
188 | |||
|
189 | def findrepo(): | |||
|
190 | p = os.getcwd() | |||
|
191 | while not os.path.isdir(os.path.join(p, ".hg")): | |||
|
192 | oldp, p = p, os.path.dirname(p) | |||
|
193 | if p == oldp: | |||
|
194 | return None | |||
|
195 | ||||
|
196 | return p | |||
|
197 | ||||
189 | def parse(ui, args): |
|
198 | def parse(ui, args): | |
190 | options = {} |
|
199 | options = {} | |
191 | cmdoptions = {} |
|
200 | cmdoptions = {} | |
@@ -259,7 +268,7 b' def dispatch(ui, args):' | |||||
259 | # this will trigger its extensions to load |
|
268 | # this will trigger its extensions to load | |
260 | path = earlygetopt(["-R", "--repository"], args) |
|
269 | path = earlygetopt(["-R", "--repository"], args) | |
261 | if not path: |
|
270 | if not path: | |
262 |
path = |
|
271 | path = findrepo() or "" | |
263 | if path: |
|
272 | if path: | |
264 | try: |
|
273 | try: | |
265 | lui = commands.ui.ui(parentui=ui) |
|
274 | lui = commands.ui.ui(parentui=ui) |
@@ -12,15 +12,6 b' import changelog, dirstate, filelog, man' | |||||
12 | import re, lock, transaction, tempfile, stat, mdiff, errno, ui |
|
12 | import re, lock, transaction, tempfile, stat, mdiff, errno, ui | |
13 | import os, revlog, time, util |
|
13 | import os, revlog, time, util | |
14 |
|
14 | |||
15 | def findrepo(): |
|
|||
16 | p = os.getcwd() |
|
|||
17 | while not os.path.isdir(os.path.join(p, ".hg")): |
|
|||
18 | oldp, p = p, os.path.dirname(p) |
|
|||
19 | if p == oldp: |
|
|||
20 | return None |
|
|||
21 |
|
||||
22 | return p |
|
|||
23 |
|
||||
24 | class localrepository(repo.repository): |
|
15 | class localrepository(repo.repository): | |
25 | capabilities = ('lookup', 'changegroupsubset') |
|
16 | capabilities = ('lookup', 'changegroupsubset') | |
26 | supported = ('revlogv1', 'store') |
|
17 | supported = ('revlogv1', 'store') |
General Comments 0
You need to be logged in to leave comments.
Login now