Pierre-Yves David avatar Pierre-Yves David committed af29fbb Merge

merge with qsync fix

Comments (0)

Files changed (1)

     except error.RepoLookupError:
         parent = initqsubmit(mqrepo)
     store, data, touched = fillstore(repo, parent)
-    if not touched:
-        raise util.Abort('Nothing changed')
-    files = ['qsubmitdata', 'series'] + touched
-    # mark some as ready for review
-    message = 'qsubmit commit\n\n'
-    review_list = []
-    applied_list = []
-    if review:
-        olddata = get_old_data(parent)
-        oldfiles = dict([(name, bin(ctxhex)) for ctxhex, name in olddata])
+    try:
+        if not touched:
+            raise util.Abort('Nothing changed')
+        files = ['qsubmitdata', 'series'] + touched
+        # mark some as ready for review
+        message = 'qsubmit commit\n\n'
+        review_list = []
+        applied_list = []
+        if review:
+            olddata = get_old_data(parent)
+            oldfiles = dict([(name, bin(ctxhex)) for ctxhex, name in olddata])
 
-        for patch_name in touched:
-            try:
-                store.getfile(patch_name)
-                review_list.append(patch_name)
-            except IOError:
-                oldnode = oldfiles[patch_name]
-                evolve = extensions.find('evolve')
-                newnodes = evolve.successorssets(repo, oldnode)
-                if newnodes:
-                    newnodes = [n for n in newnodes if n and n[0] in repo] # remove killing
-                if not newnodes:
-                    # changeset has been killed (eg. reject)
-                    pass
-                else:
-                    assert len(newnodes) == 1 # conflict!!!
-                    newnode = newnodes[0]
-                    assert len(newnode) == 1 # split unsupported for now
-                    newnode = list(newnode)[0]
-                    # XXX unmanaged case where a cs is obsoleted by an unavailable one
-                    #if newnode.node() not in repo.changelog.nodemap:
-                    #    raise util.Abort('%s is obsoleted by an unknown node %s'% (oldnode, newnode))
-                    ctx = repo[newnode]
-                    if ctx.phase() == phases.public:
-                        # applied
-                        applied_list.append(patch_name)
-                    elif ctx.phase() == phases.secret:
-                        # already exported changeset is now secret
-                        repo.ui.warn("An already exported changeset is now secret!!!")
+            for patch_name in touched:
+                try:
+                    store.getfile(patch_name)
+                    review_list.append(patch_name)
+                except IOError:
+                    oldnode = oldfiles[patch_name]
+                    evolve = extensions.find('evolve')
+                    newnodes = evolve.successorssets(repo, oldnode)
+                    if newnodes:
+                        newnodes = [n for n in newnodes if n and n[0] in repo] # remove killing
+                    if not newnodes:
+                        # changeset has been killed (eg. reject)
+                        pass
                     else:
-                        # draft
-                        assert False, "Should be exported"
+                        assert len(newnodes) == 1 # conflict!!!
+                        newnode = newnodes[0]
+                        assert len(newnode) == 1 # split unsupported for now
+                        newnode = list(newnode)[0]
+                        # XXX unmanaged case where a cs is obsoleted by an unavailable one
+                        #if newnode.node() not in repo.changelog.nodemap:
+                        #    raise util.Abort('%s is obsoleted by an unknown node %s'% (oldnode, newnode))
+                        ctx = repo[newnode]
+                        if ctx.phase() == phases.public:
+                            # applied
+                            applied_list.append(patch_name)
+                        elif ctx.phase() == phases.secret:
+                            # already exported changeset is now secret
+                            repo.ui.warn("An already exported changeset is now secret!!!")
+                        else:
+                            # draft
+                            assert False, "Should be exported"
 
-    if review:
-        if applied_list:
-            message += '\n'.join('* applied %s' % x for x in applied_list) + '\n'
-        if review_list:
-            message += '\n'.join('* %s ready for review' % x for x in review_list) + '\n'
-    memctx = patch.makememctx(mqrepo, (parent.node(), nullid),
-                              message,
-                              None,
-                              None,
-                              parent.branch(), files, store,
-                              editor=None)
-    if review == 'edit':
-        memctx._text = cmdutil.commitforceeditor(mqrepo, memctx, [])
-    mqrepo.savecommitmessage(memctx.description())
-    n = memctx.commit()
+        if review:
+            if applied_list:
+                message += '\n'.join('* applied %s' % x for x in applied_list) + '\n'
+            if review_list:
+                message += '\n'.join('* %s ready for review' % x for x in review_list) + '\n'
+        memctx = patch.makememctx(mqrepo, (parent.node(), nullid),
+                                  message,
+                                  None,
+                                  None,
+                                  parent.branch(), files, store,
+                                  editor=None)
+        if review == 'edit':
+            memctx._text = cmdutil.commitforceeditor(mqrepo, memctx, [])
+        mqrepo.savecommitmessage(memctx.description())
+        n = memctx.commit()
+    finally:
+        store.close()
     return 0
 
 
         # export data to ease futur work
         store.setfile('qsubmitdata', json.dumps(data, indent=True),
                       (False, False))
-    finally:
+    except:
         store.close()
+	raise
     return store, data, touched
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.