Commits

Henrik Stuart committed ea59c4d Merge

Merge hgtk

Comments (0)

Files changed (3)

tortoisehg/hgtk/thgmq.py

 
         # update series
         q = self.repo.mq
-        series = q.full_series[:]
+        series = q.fullseries[:]
         for pos, qpos in zip(dirty, qdirty):
-            q.full_series[qpos] = series[model[pos][MQ_INDEX]]
-        if len(set(q.full_series)) != len(q.full_series):  # found duplicates
+            q.fullseries[qpos] = series[model[pos][MQ_INDEX]]
+        if len(set(q.fullseries)) != len(q.fullseries):  # found duplicates
             raise error.Abort(_('series become inconsistent during reorder'))
-        q.series_dirty = True
-        q.save_dirty()
+        q.seriesdirty = True
+        q.savedirty()
 
         # need to refresh
         self.refresh()
 
     def is_unapplied(self, name):
         if self.mqloaded:
-            return self.repo.mq.find_series(name) is not None and \
+            return self.repo.mq.findseries(name) is not None and \
                    not self.repo.mq.isapplied(name)
         return False
 

tortoisehg/util/hglib.py

 
 from mercurial import ui, util, error, extensions, match, bundlerepo, cmdutil
 from mercurial import dispatch, encoding, templatefilters, filemerge, scmutil
+from mercurial.scmutil import updatedir
 
 _encoding = encoding.encoding
 _encodingmode = encoding.encodingmode

tortoisehg/util/hgshelve.py

 
 lines_re = re.compile(r'@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)')
 
-def internalpatch(patchobj, ui, strip, cwd, files={}):
-    """use builtin patch to apply <patchobj> to the working directory.
-    returns whether patch was applied with fuzz factor.
-
-    Adapted from patch.internalpatch() to support reverse patching.
-    """
-    try:
-        fp = file(patchobj, 'rb')
-    except TypeError:
-        fp = patchobj
-    if cwd:
-        curdir = os.getcwd()
-        os.chdir(cwd)
-    eolmode = ui.config('patch', 'eol', 'strict')
-    try:
-        eol = {'strict': None,
-               'auto': None,
-               'crlf': '\r\n',
-               'lf': '\n'}[eolmode.lower()]
-    except KeyError:
-        raise error.Abort(_('Unsupported line endings type: %s') % eolmode)
-    try:
-        if hasattr(patch, 'eolmodes'): # hg-1.5 hack
-            ret = patch.applydiff(ui, fp, files, strip=strip, eolmode=eolmode)
-        else:
-            ret = patch.applydiff(ui, fp, files, strip=strip, eol=eol)
-    finally:
-        if cwd:
-            os.chdir(curdir)
-    if ret < 0:
-        raise patch.PatchError
-    return ret > 0
-
 def scanpatch(fp):
     lr = patch.linereader(fp)
 
                 if dopatch:
                     ui.debug(_('applying patch\n'))
                     ui.debug(fp.getvalue())
-                    patch.internalpatch(fp, ui, 1, repo.root, eolmode=None)
+                    patch.internalpatch(ui, repo, fp, 1, eolmode=None)
                 del fp
 
                 # 3c. apply filtered patch to clean repo (shelve)
             try:
                 try:
                     fp.seek(0)
-                    pfiles = {}
-                    internalpatch(fp, ui, 1, repo.root, files=pfiles)
-                    hglib.updatedir(ui, repo, pfiles)
+                    pfiles = set()
+                    patch.internalpatch(ui, repo, fp, 1, files=pfiles)
+                    hglib.updatedir(ui, repo, dict([(z, None) for z in pfiles]))
                     patchdone = 1
                 except:
                     if opts['force']: