mercurial/cmdutil.py
changeset 22901 722117c8e023
parent 22807 cd43195ef876
child 22951 6c86c673dde6
equal deleted inserted replaced
22900:7bf82faba774 22901:722117c8e023
  2103             ui.status(_("skipping missing subrepository: %s\n")
  2103             ui.status(_("skipping missing subrepository: %s\n")
  2104                            % os.path.join(prefix, subpath))
  2104                            % os.path.join(prefix, subpath))
  2105 
  2105 
  2106     return err
  2106     return err
  2107 
  2107 
  2108 def duplicatecopies(repo, rev, fromrev, skiprev=None):
       
  2109     '''reproduce copies from fromrev to rev in the dirstate
       
  2110 
       
  2111     If skiprev is specified, it's a revision that should be used to
       
  2112     filter copy records. Any copies that occur between fromrev and
       
  2113     skiprev will not be duplicated, even if they appear in the set of
       
  2114     copies between fromrev and rev.
       
  2115     '''
       
  2116     exclude = {}
       
  2117     if skiprev is not None:
       
  2118         exclude = copies.pathcopies(repo[fromrev], repo[skiprev])
       
  2119     for dst, src in copies.pathcopies(repo[fromrev], repo[rev]).iteritems():
       
  2120         # copies.pathcopies returns backward renames, so dst might not
       
  2121         # actually be in the dirstate
       
  2122         if dst in exclude:
       
  2123             continue
       
  2124         if repo.dirstate[dst] in "nma":
       
  2125             repo.dirstate.copy(src, dst)
       
  2126 
       
  2127 def commit(ui, repo, commitfunc, pats, opts):
  2108 def commit(ui, repo, commitfunc, pats, opts):
  2128     '''commit the specified files or all outstanding changes'''
  2109     '''commit the specified files or all outstanding changes'''
  2129     date = opts.get('date')
  2110     date = opts.get('date')
  2130     if date:
  2111     if date:
  2131         opts['date'] = util.parsedate(date)
  2112         opts['date'] = util.parsedate(date)