Print this page
OS-1823 git-pbchk should not depend on mercurial

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/onbld/hgext/cdm.py
          +++ new/usr/src/tools/onbld/hgext/cdm.py
↓ open down ↓ 8 lines elided ↑ open up ↑
   9    9  #  GNU General Public License for more details.
  10   10  #
  11   11  #  You should have received a copy of the GNU General Public License
  12   12  #  along with this program; if not, write to the Free Software
  13   13  #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  14   14  #
  15   15  
  16   16  #
  17   17  # Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  18   18  # Copyright 2008, 2011 Richard Lowe
       19 +# Copyright (c) 2013, Joyent Inc. All rights reserved.
  19   20  #
  20   21  
  21   22  '''OpenSolaris extensions to Mercurial
  22   23  
  23   24      This extension contains a number of commands to help you work with
  24   25  the OpenSolaris consolidations.  It provides commands to check your
  25   26  changes against the various style rules used for OpenSolaris, to
  26   27  backup and restore your changes, to generate code reviews, and to
  27   28  prepare your changes for integration.
  28   29  
↓ open down ↓ 56 lines elided ↑ open up ↑
  85   86                                  "python%d.%d" % sys.version_info[:2]))
  86   87  
  87   88  #
  88   89  # Add the relative path from cdm.py to usr/src/tools to the load path,
  89   90  # such that a cdm.py loaded from the source tree uses the modules also
  90   91  # within the source tree.
  91   92  #
  92   93  sys.path.insert(2, os.path.join(os.path.dirname(__file__), "..", ".."))
  93   94  
  94   95  from onbld.Scm import Version
       96 +from onbld.Scm import Ignore
  95   97  from mercurial import util
  96   98  
  97   99  try:
  98  100      Version.check_version()
  99  101  except Version.VersionMismatch, badversion:
 100  102      raise util.Abort("Version Mismatch:\n %s\n" % badversion)
 101  103  
 102      -from mercurial import cmdutil, ignore, node, patch
      104 +from mercurial import cmdutil, node, patch
 103  105  
 104  106  from onbld.Scm.WorkSpace import WorkSpace, WorkList
 105  107  from onbld.Scm.Backup import CdmBackup
 106  108  from onbld.Checks import Cddl, Comments, Copyright, CStyle, HdrChk
 107  109  from onbld.Checks import JStyle, Keywords, Mapfile
 108  110  
 109  111  
 110  112  def yes_no(ui, msg, default):
 111  113      if default:
 112  114          prompt = ' [Y/n]:'
↓ open down ↓ 47 lines elided ↑ open up ↑
 160  162          return f
 161  163  
 162  164      ignorefiles = []
 163  165  
 164  166      for f in [repo.join('cdm/%s.NOT' % cmd),
 165  167                 repo.wjoin('exception_lists/%s' % cmd)]:
 166  168          if os.path.exists(f):
 167  169              ignorefiles.append(f)
 168  170  
 169  171      if ignorefiles:
 170      -        ign = ignore.ignore(repo.root, ignorefiles, repo.ui.warn)
      172 +        ign = Ignore.ignore(repo.root, ignorefiles)
 171  173          return canonified_check(ign)
 172  174      else:
 173  175          return util.never
 174  176  
 175  177  
 176  178  def abort_if_dirty(ws):
 177  179      '''Abort if the workspace has uncommitted changes, merges,
 178  180      branches, or has Mq patches applied'''
 179  181  
 180  182      if ws.modified():
↓ open down ↓ 1307 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX