Commits

Dan Villiom Podlaski Christiansen committed e2e43aa

new patch

  • Participants
  • Parent commits 90cf89c

Comments (0)

Files changed (2)

File multipush.diff

+# HG changeset patch
+# Parent 8d5c96134c70e70908be7fb5f04a9210e721b757
+# User Dan Villiom Podlaski Christiansen <dan@cabo.dk>
+support pushing multiple changesets
+
+diff --git a/perfarce.py b/perfarce.py
+--- a/perfarce.py
++++ b/perfarce.py
+@@ -1079,11 +1079,8 @@ class p4client(object):
+                 raise util.Abort(
+                     _('cowardly refusing to push more than one changeset'))
+ 
+-        # find changed files
+-        if not nodes:
+-            mod = add = rem = []
+-            cpy = {}
+-        else:
++        for node in nodes:
++            # find changed files
+             mod, add, rem = repo.status(node1=ctx1.node(), node2=ctx2.node())[:3]
+             mod = [(f, ctx2.flags(f)) for f in mod]
+             add = [(f, ctx2.flags(f)) for f in add]
+@@ -1110,41 +1107,31 @@ class p4client(object):
+                     else:
+                         i += 1
+ 
+-        if not (mod or add or rem):
+-            ui.status(_('no changes found\n'))
+-            return True, out and 1 or 0
++            if not (mod or add or rem):
++                ui.status(_('no changes found\n'))
++                continue
+ 
+-        # detect MQ
+-        try:
+-            mq = repo.changelog.nodesbetween([repo['qbase'].node()], nodes)[0]
+-            if mq:
+-                if opts['force']:
+-                    ui.warn(_('source has mq patches applied\n'))
+-                else:
+-                    raise util.Abort(_('source has mq patches applied'))
+-        except error.RepoError:
+-            pass
+-        except error.RepoLookupError:
+-            pass
++            # detect MQ
++            try:
++                mq = repo.changelog.nodesbetween([repo['qbase'].node()], node)[0]
++                if mq:
++                    if opts['force']:
++                        ui.warn(_('source has mq patches applied\n'))
++                    else:
++                        raise util.Abort(_('source has mq patches applied'))
++            except error.RepoError:
++                pass
++            except error.RepoLookupError:
++                pass
+ 
+-        # create description
+-        desc = []
+-        for n in nodes:
+-            desc.append(repo[n].description())
++            # create description
++            desc = repo[node].description()
+ 
+-        if len(nodes) > 1:
+-            h = [repo[nodes[0]].hex()]
+-        else:
+-            h = []
+-        h.append(repo[nodes[-1]].hex())
+-
+-        desc='\n* * *\n'.join(desc)
+-
+-        if ui.debugflag:
+-            ui.debug('mod = %r\n' % (mod,))
+-            ui.debug('add = %r\n' % (add,))
+-            ui.debug('rem = %r\n' % (rem,))
+-            ui.debug('cpy = %r\n' % (cpy,))
++            if ui.debugflag:
++                ui.debug('mod = %r\n' % (mod,))
++                ui.debug('add = %r\n' % (add,))
++                ui.debug('rem = %r\n' % (rem,))
++                ui.debug('cpy = %r\n' % (cpy,))
+ 
+         return False, (client, p4rev, p4id, nodes, ctx2, desc, mod, add, rem, cpy)
+ 
 helpful-comment.diff
 mercurial-2.3.diff
 push-like-hgsubversion.diff
+multipush.diff