Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/cmdutil.py @ 25930:221491bbaf7e
cmdutil: break import cycle
This was the easiest place to break the chain, as there were only
2 uses of the imported module in the file.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 08 Aug 2015 00:47:19 -0700 |
parents | 69145daacdfa |
children | 027763aed157 |
comparison
equal
deleted
inserted
replaced
25929:289149111d46 | 25930:221491bbaf7e |
---|---|
8 from node import hex, bin, nullid, nullrev, short | 8 from node import hex, bin, nullid, nullrev, short |
9 from i18n import _ | 9 from i18n import _ |
10 import os, sys, errno, re, tempfile, cStringIO, shutil | 10 import os, sys, errno, re, tempfile, cStringIO, shutil |
11 import util, scmutil, templater, patch, error, templatekw, revlog, copies | 11 import util, scmutil, templater, patch, error, templatekw, revlog, copies |
12 import match as matchmod | 12 import match as matchmod |
13 import context, repair, graphmod, revset, phases, obsolete, pathutil | 13 import repair, graphmod, revset, phases, obsolete, pathutil |
14 import changelog | 14 import changelog |
15 import bookmarks | 15 import bookmarks |
16 import encoding | 16 import encoding |
17 import formatter | 17 import formatter |
18 import crecord as crecordmod | 18 import crecord as crecordmod |
846 :msgs: list to save commit message to. | 846 :msgs: list to save commit message to. |
847 (used in case we need to save it when failing) | 847 (used in case we need to save it when failing) |
848 :updatefunc: a function that update a repo to a given node | 848 :updatefunc: a function that update a repo to a given node |
849 updatefunc(<repo>, <node>) | 849 updatefunc(<repo>, <node>) |
850 """ | 850 """ |
851 # avoid cycle context -> subrepo -> cmdutil | |
852 import context | |
851 tmpname, message, user, date, branch, nodeid, p1, p2 = \ | 853 tmpname, message, user, date, branch, nodeid, p1, p2 = \ |
852 patch.extract(ui, hunk) | 854 patch.extract(ui, hunk) |
853 | 855 |
854 update = not opts.get('bypass') | 856 update = not opts.get('bypass') |
855 strip = opts["strip"] | 857 strip = opts["strip"] |
2462 _("failed to mark all new/missing files as added/removed")) | 2464 _("failed to mark all new/missing files as added/removed")) |
2463 | 2465 |
2464 return commitfunc(ui, repo, message, matcher, opts) | 2466 return commitfunc(ui, repo, message, matcher, opts) |
2465 | 2467 |
2466 def amend(ui, repo, commitfunc, old, extra, pats, opts): | 2468 def amend(ui, repo, commitfunc, old, extra, pats, opts): |
2469 # avoid cycle context -> subrepo -> cmdutil | |
2470 import context | |
2471 | |
2467 # amend will reuse the existing user if not specified, but the obsolete | 2472 # amend will reuse the existing user if not specified, but the obsolete |
2468 # marker creation requires that the current user's name is specified. | 2473 # marker creation requires that the current user's name is specified. |
2469 if obsolete.isenabled(repo, obsolete.createmarkersopt): | 2474 if obsolete.isenabled(repo, obsolete.createmarkersopt): |
2470 ui.username() # raise exception if username not set | 2475 ui.username() # raise exception if username not set |
2471 | 2476 |