Mercurial > public > mercurial-scm > hg-stable
diff 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 |
line wrap: on
line diff
--- a/mercurial/cmdutil.py Sun Jul 05 12:50:09 2015 +0900 +++ b/mercurial/cmdutil.py Sat Aug 08 00:47:19 2015 -0700 @@ -10,7 +10,7 @@ import os, sys, errno, re, tempfile, cStringIO, shutil import util, scmutil, templater, patch, error, templatekw, revlog, copies import match as matchmod -import context, repair, graphmod, revset, phases, obsolete, pathutil +import repair, graphmod, revset, phases, obsolete, pathutil import changelog import bookmarks import encoding @@ -848,6 +848,8 @@ :updatefunc: a function that update a repo to a given node updatefunc(<repo>, <node>) """ + # avoid cycle context -> subrepo -> cmdutil + import context tmpname, message, user, date, branch, nodeid, p1, p2 = \ patch.extract(ui, hunk) @@ -2464,6 +2466,9 @@ return commitfunc(ui, repo, message, matcher, opts) def amend(ui, repo, commitfunc, old, extra, pats, opts): + # avoid cycle context -> subrepo -> cmdutil + import context + # amend will reuse the existing user if not specified, but the obsolete # marker creation requires that the current user's name is specified. if obsolete.isenabled(repo, obsolete.createmarkersopt):