comparison push_cmd.py @ 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 57355b0e7bd1
children 06eb60f9a026
comparison
equal deleted inserted replaced
205:30df375590d1 206:c2e51d6a2d7b
146 if not e[1] or not e[2]: 146 if not e[1] or not e[2]:
147 for d in finddirs(e[0], True): 147 for d in finddirs(e[0], True):
148 changeddirs[d] = 1 148 changeddirs[d] = 1
149 if not changeddirs: 149 if not changeddirs:
150 return added, deleted 150 return added, deleted
151 olddirs = getctxdirs(parentctx, changeddirs, 151 olddirs = getctxdirs(parentctx, changeddirs,
152 [e[0] for e in extchanges if e[1]]) 152 [e[0] for e in extchanges if e[1]])
153 newdirs = getctxdirs(ctx, changeddirs, 153 newdirs = getctxdirs(ctx, changeddirs,
154 [e[0] for e in extchanges if e[2]]) 154 [e[0] for e in extchanges if e[2]])
155 155
156 for d in newdirs: 156 for d in newdirs:
179 branch_path = 'trunk' 179 branch_path = 'trunk'
180 180
181 if parent_branch and parent_branch != 'default': 181 if parent_branch and parent_branch != 'default':
182 branch_path = 'branches/%s' % parent_branch 182 branch_path = 'branches/%s' % parent_branch
183 183
184 extchanges = list(svnexternals.diff(_externals(parent), 184 extchanges = list(svnexternals.diff(_externals(parent),
185 _externals(rev_ctx))) 185 _externals(rev_ctx)))
186 addeddirs, deleteddirs = _getdirchanges(svn, branch_path, parent, rev_ctx, 186 addeddirs, deleteddirs = _getdirchanges(svn, branch_path, parent, rev_ctx,
187 rev_ctx.files(), extchanges) 187 rev_ctx.files(), extchanges)
188 deleteddirs = set(deleteddirs) 188 deleteddirs = set(deleteddirs)
189 189
271 try: 271 try:
272 svn.commit(new_target_files, rev_ctx.description(), file_data, 272 svn.commit(new_target_files, rev_ctx.description(), file_data,
273 base_revision, set(addeddirs), set(deleteddirs), 273 base_revision, set(addeddirs), set(deleteddirs),
274 props, newcopies) 274 props, newcopies)
275 except core.SubversionException, e: 275 except core.SubversionException, e:
276 if hasattr(e, 'apr_err') and e.apr_err == 160028: 276 if hasattr(e, 'apr_err') and (e.apr_err == core.SVN_ERR_FS_TXN_OUT_OF_DATE
277 or e.apr_err == core.SVN_ERR_FS_CONFLICT):
277 raise merc_util.Abort('Base text was out of date, maybe rebase?') 278 raise merc_util.Abort('Base text was out of date, maybe rebase?')
278 else: 279 else:
279 raise 280 raise