Show More
@@ -9,7 +9,7 b' from node import *' | |||
|
9 | 9 | from i18n import _ |
|
10 | 10 | import os, sys, mdiff, bdiff, util, templater, patch, commands |
|
11 | 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 | 14 | revrangesep = ':' |
|
15 | 15 | |
@@ -186,6 +186,15 b' def findcmd(ui, cmd):' | |||
|
186 | 186 | |
|
187 | 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 | 198 | def parse(ui, args): |
|
190 | 199 | options = {} |
|
191 | 200 | cmdoptions = {} |
@@ -259,7 +268,7 b' def dispatch(ui, args):' | |||
|
259 | 268 | # this will trigger its extensions to load |
|
260 | 269 | path = earlygetopt(["-R", "--repository"], args) |
|
261 | 270 | if not path: |
|
262 |
path = |
|
|
271 | path = findrepo() or "" | |
|
263 | 272 | if path: |
|
264 | 273 | try: |
|
265 | 274 | lui = commands.ui.ui(parentui=ui) |
@@ -12,15 +12,6 b' import changelog, dirstate, filelog, man' | |||
|
12 | 12 | import re, lock, transaction, tempfile, stat, mdiff, errno, ui |
|
13 | 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 | 15 | class localrepository(repo.repository): |
|
25 | 16 | capabilities = ('lookup', 'changegroupsubset') |
|
26 | 17 | supported = ('revlogv1', 'store') |
General Comments 0
You need to be logged in to leave comments.
Login now