changeset 206:c2e51d6a2d7b

push: Converted a magic number to an actual constant, and catch another apr_err that appears to also mean base text out of date.
author Augie Fackler <durin42@gmail.com>
date Tue, 03 Mar 2009 10:13:40 -0600
parents 30df375590d1
children b20a6c149021
files push_cmd.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/push_cmd.py
+++ b/push_cmd.py
@@ -148,7 +148,7 @@ def _getdirchanges(svn, branchpath, pare
                 changeddirs[d] = 1
     if not changeddirs:
         return added, deleted
-    olddirs = getctxdirs(parentctx, changeddirs, 
+    olddirs = getctxdirs(parentctx, changeddirs,
                          [e[0] for e in extchanges if e[1]])
     newdirs = getctxdirs(ctx, changeddirs,
                          [e[0] for e in extchanges if e[2]])
@@ -181,7 +181,7 @@ def commit_from_rev(ui, repo, rev_ctx, h
     if parent_branch and parent_branch != 'default':
         branch_path = 'branches/%s' % parent_branch
 
-    extchanges = list(svnexternals.diff(_externals(parent), 
+    extchanges = list(svnexternals.diff(_externals(parent),
                                         _externals(rev_ctx)))
     addeddirs, deleteddirs = _getdirchanges(svn, branch_path, parent, rev_ctx,
                                             rev_ctx.files(), extchanges)
@@ -273,7 +273,8 @@ def commit_from_rev(ui, repo, rev_ctx, h
                    base_revision, set(addeddirs), set(deleteddirs),
                    props, newcopies)
     except core.SubversionException, e:
-        if hasattr(e, 'apr_err') and e.apr_err == 160028:
+        if hasattr(e, 'apr_err') and (e.apr_err == core.SVN_ERR_FS_TXN_OUT_OF_DATE
+                                      or e.apr_err == core.SVN_ERR_FS_CONFLICT):
             raise merc_util.Abort('Base text was out of date, maybe rebase?')
         else:
             raise