Mercurial > hgsubversion
comparison svnwrap/svn_swig_wrapper.py @ 172:84fbf1469a31
SubversionRepo: simplify and rename proplist() into list_prop()
list_prop() will be used to retrieve svn:externals properties. Current
implementation was unused and was simplified to match the use case.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Tue, 30 Dec 2008 20:33:59 -0600 |
parents | ba801f44d240 |
children | 2412800b1258 |
comparison
equal
deleted
inserted
replaced
171:b77a4caaf77b | 172:84fbf1469a31 |
---|---|
463 linkprefix = "link " | 463 linkprefix = "link " |
464 if data.startswith(linkprefix): | 464 if data.startswith(linkprefix): |
465 data = data[len(linkprefix):] | 465 data = data[len(linkprefix):] |
466 return data, mode | 466 return data, mode |
467 | 467 |
468 def proplist(self, path, revision, recurse=False): | 468 def list_props(self, path, revision): |
469 if path[-1] == '/': | 469 """Return a mapping of property names to values, raise IOError if |
470 path = path[:-1] | 470 specified path does not exist. |
471 if path[0] == '/': | 471 """ |
472 path = path[1:] | |
473 rev = optrev(revision) | 472 rev = optrev(revision) |
474 pl = dict(client.proplist2(self.svn_url+'/'+path, rev, rev, True, | 473 rpath = (self.svn_url + '/' + path.strip('/')).strip('/') |
475 self.client_context, self.pool)) | 474 try: |
476 pl2 = {} | 475 pl = client.proplist2(rpath, rev, rev, False, |
477 for key, value in pl.iteritems(): | 476 self.client_context, self.pool) |
478 pl2[key[len(self.svn_url)+1:]] = value | 477 except core.SubversionException, e: |
479 return pl2 | 478 # Specified path does not exist at this revision |
479 if e.apr_err == core.SVN_ERR_NODE_UNKNOWN_KIND: | |
480 raise IOError() | |
481 raise | |
482 if not pl: | |
483 return {} | |
484 return pl[0][1] | |
480 | 485 |
481 def fetch_all_files_to_dir(self, path, revision, checkout_path): | 486 def fetch_all_files_to_dir(self, path, revision, checkout_path): |
482 rev = optrev(revision) | 487 rev = optrev(revision) |
483 client.export3(self.svn_url+'/'+path, checkout_path, rev, | 488 client.export3(self.svn_url+'/'+path, checkout_path, rev, |
484 rev, True, True, True, 'LF', # should be 'CRLF' on win32 | 489 rev, True, True, True, 'LF', # should be 'CRLF' on win32 |