equal
deleted
inserted
replaced
3 # Copyright 2009-2010 Matt Mackall <mpm@selenic.com> |
3 # Copyright 2009-2010 Matt Mackall <mpm@selenic.com> |
4 # |
4 # |
5 # This software may be used and distributed according to the terms of the |
5 # This software may be used and distributed according to the terms of the |
6 # GNU General Public License version 2 or any later version. |
6 # GNU General Public License version 2 or any later version. |
7 |
7 |
|
8 from __future__ import absolute_import |
|
9 |
8 import copy |
10 import copy |
9 import errno, os, re, posixpath, sys |
11 import errno |
|
12 import os |
|
13 import posixpath |
|
14 import re |
|
15 import stat |
|
16 import subprocess |
|
17 import sys |
|
18 import tarfile |
10 import xml.dom.minidom |
19 import xml.dom.minidom |
11 import stat, subprocess, tarfile |
20 |
12 from i18n import _ |
21 |
13 import config, util, node, error, cmdutil, scmutil, match as matchmod |
22 from .i18n import _ |
14 import phases |
23 from . import ( |
15 import pathutil |
24 cmdutil, |
16 import exchange |
25 config, |
|
26 error, |
|
27 exchange, |
|
28 match as matchmod, |
|
29 node, |
|
30 pathutil, |
|
31 phases, |
|
32 scmutil, |
|
33 util, |
|
34 ) |
|
35 |
17 hg = None |
36 hg = None |
18 propertycache = util.propertycache |
37 propertycache = util.propertycache |
19 |
38 |
20 nullstate = ('', '', 'empty') |
39 nullstate = ('', '', 'empty') |
21 |
40 |
326 # subrepo inherently violates our import layering rules |
345 # subrepo inherently violates our import layering rules |
327 # because it wants to make repo objects from deep inside the stack |
346 # because it wants to make repo objects from deep inside the stack |
328 # so we manually delay the circular imports to not break |
347 # so we manually delay the circular imports to not break |
329 # scripts that don't use our demand-loading |
348 # scripts that don't use our demand-loading |
330 global hg |
349 global hg |
331 import hg as h |
350 from . import hg as h |
332 hg = h |
351 hg = h |
333 |
352 |
334 pathutil.pathauditor(ctx.repo().root)(path) |
353 pathutil.pathauditor(ctx.repo().root)(path) |
335 state = ctx.substate[path] |
354 state = ctx.substate[path] |
336 if state[2] not in types: |
355 if state[2] not in types: |
344 # subrepo inherently violates our import layering rules |
363 # subrepo inherently violates our import layering rules |
345 # because it wants to make repo objects from deep inside the stack |
364 # because it wants to make repo objects from deep inside the stack |
346 # so we manually delay the circular imports to not break |
365 # so we manually delay the circular imports to not break |
347 # scripts that don't use our demand-loading |
366 # scripts that don't use our demand-loading |
348 global hg |
367 global hg |
349 import hg as h |
368 from . import hg as h |
350 hg = h |
369 hg = h |
351 |
370 |
352 pathutil.pathauditor(ctx.repo().root)(path) |
371 pathutil.pathauditor(ctx.repo().root)(path) |
353 state = ctx.substate[path] |
372 state = ctx.substate[path] |
354 if state[2] not in types: |
373 if state[2] not in types: |