Commits

Anonymous committed b620c7b

Simplify and fix revspec, based on an idea by Baptiste Carvello.
Drop sourcebranch from schema.

Comments (0)

Files changed (2)

extensions/create_patch.py

             raise NotChanged
         repo=bundlerepo.bundlerepository(UI, ".", bundle)
         repo.ui.pushbuffer()
-        old = 'max(p1(min(outgoing() and branch(%s))) or max(p2(merge() and outgoing() and branch(%s)) and branch(%s) and not outgoing()))' % (patchbranch, patchbranch, sourcebranch)
+        old = 'max(ancestors(branch("%s")))-outgoing("%s"))' % (patchbranch, base)
         commands.diff(repo.ui, repo, rev=[old, patchbranch])
         result = repo.ui.popbuffer()
     finally:
 hgrepo = Class(db, "hgrepo",
                url=String(),
                lastrev=String(),
-               sourcebranch=String(),
                patchbranch=String(),
                )
 
     return userid == db.hgrepo.get(itemid, "creator")
 db.security.addPermissionToRole('User', 'Create', 'hgrepo')
 p = db.security.addPermission(name='Edit', klass='hgrepo', check=may_edit_hgrepo,
-                              properties=['url', 'sourcebranch', 'patchbranch'])
+                              properties=['url', 'patchbranch'])
 db.security.addPermissionToRole('User', p)
 
 class may_view_spam: