comparison util.py @ 250:79349fd04836

utils: standardizing imported name to hgutil, our_util to util
author Daniel Tang <dytang@cs.purdue.edu>
date Fri, 10 Apr 2009 13:43:44 -0400
parents a065bf61caa1
children c3d5c4ae9c7c
comparison
equal deleted inserted replaced
249:a065bf61caa1 250:79349fd04836
1 import os 1 import os
2 import shutil 2 import shutil
3 3
4 from mercurial import hg 4 from mercurial import hg
5 from mercurial import node 5 from mercurial import node
6 from mercurial import util 6 from mercurial import util as hgutil
7 7
8 svn_subcommands = { } 8 svn_subcommands = { }
9 def register_subcommand(name): 9 def register_subcommand(name):
10 def inner(fn): 10 def inner(fn):
11 svn_subcommands[name] = fn 11 svn_subcommands[name] = fn
94 while (not sourcerev.node() in reverse_map 94 while (not sourcerev.node() in reverse_map
95 and sourcerev.node() != node.nullid): 95 and sourcerev.node() != node.nullid):
96 outgoing_rev_hashes.append(sourcerev.node()) 96 outgoing_rev_hashes.append(sourcerev.node())
97 sourcerev = sourcerev.parents() 97 sourcerev = sourcerev.parents()
98 if len(sourcerev) != 1: 98 if len(sourcerev) != 1:
99 raise util.Abort("Sorry, can't find svn parent of a merge revision.") 99 raise hgutil.Abort("Sorry, can't find svn parent of a merge revision.")
100 sourcerev = sourcerev[0] 100 sourcerev = sourcerev[0]
101 if sourcerev.node() != node.nullid: 101 if sourcerev.node() != node.nullid:
102 return outgoing_rev_hashes 102 return outgoing_rev_hashes
103 103
104 def build_extra(revnum, branch, uuid, subdir): 104 def build_extra(revnum, branch, uuid, subdir):
142 try: 142 try:
143 from mercurial import encoding 143 from mercurial import encoding
144 old = encoding.encoding 144 old = encoding.encoding
145 encoding.encoding = new_encoding 145 encoding.encoding = new_encoding
146 except ImportError: 146 except ImportError:
147 old = util._encoding 147 old = hgutil._encoding
148 util._encoding = new_encoding 148 hgutil._encoding = new_encoding
149 return old 149 return old