mercurial/commands.py
changeset 4956 02b127749dc0
parent 4954 90be978c9d3d
child 4965 4106dde15aed
equal deleted inserted replaced
4955:9bbc0217209b 4956:02b127749dc0
     6 # of the GNU General Public License, incorporated herein by reference.
     6 # of the GNU General Public License, incorporated herein by reference.
     7 
     7 
     8 import demandimport; demandimport.enable()
     8 import demandimport; demandimport.enable()
     9 from node import *
     9 from node import *
    10 from i18n import _
    10 from i18n import _
    11 import bisect, os, re, sys, urllib, shlex, stat
    11 import bisect, os, re, sys, urllib, stat
    12 import ui, hg, util, revlog, bundlerepo, extensions
    12 import ui, hg, util, revlog, bundlerepo, extensions
    13 import difflib, patch, time, help, mdiff, tempfile
    13 import difflib, patch, time, help, mdiff, tempfile
    14 import errno, version, socket
    14 import errno, version, socket
    15 import archival, changegroup, cmdutil, hgweb.server, sshserver
    15 import archival, changegroup, cmdutil, hgweb.server, sshserver
    16 
    16 
  2195     To undo a remove before that, see hg revert.
  2195     To undo a remove before that, see hg revert.
  2196 
  2196 
  2197     Modified files and added files are not removed by default.  To
  2197     Modified files and added files are not removed by default.  To
  2198     remove them, use the -f/--force option.
  2198     remove them, use the -f/--force option.
  2199     """
  2199     """
  2200     names = []
       
  2201     if not opts['after'] and not pats:
  2200     if not opts['after'] and not pats:
  2202         raise util.Abort(_('no files specified'))
  2201         raise util.Abort(_('no files specified'))
  2203     files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts)
  2202     files, matchfn, anypats = cmdutil.matchpats(repo, pats, opts)
  2204     exact = dict.fromkeys(files)
  2203     exact = dict.fromkeys(files)
  2205     mardu = map(dict.fromkeys, repo.status(files=files, match=matchfn))[:5]
  2204     mardu = map(dict.fromkeys, repo.status(files=files, match=matchfn))[:5]
  2657 
  2656 
  2658     Apply one or more compressed changegroup files generated by the
  2657     Apply one or more compressed changegroup files generated by the
  2659     bundle command.
  2658     bundle command.
  2660     """
  2659     """
  2661     fnames = (fname1,) + fnames
  2660     fnames = (fname1,) + fnames
  2662     result = None
       
  2663     for fname in fnames:
  2661     for fname in fnames:
  2664         if os.path.exists(fname):
  2662         if os.path.exists(fname):
  2665             f = open(fname, "rb")
  2663             f = open(fname, "rb")
  2666         else:
  2664         else:
  2667             f = urllib.urlopen(fname)
  2665             f = urllib.urlopen(fname)