Backup.py revision 2b5878de2735cb61d008168e1f27e390d2edf915
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs# This program is free software; you can redistribute it and/or modify
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs# it under the terms of the GNU General Public License version 2
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs# as published by the Free Software Foundation.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs# This program is distributed in the hope that it will be useful,
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs# but WITHOUT ANY WARRANTY; without even the implied warranty of
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs# GNU General Public License for more details.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs# You should have received a copy of the GNU General Public License
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs# along with this program; if not, write to the Free Software
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs# Use is subject to license terms.
377116851d972902caefc86c848359c0273d8487wlWorkspace backup
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphsBackup format is:
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs generation#/
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs dirstate (handled by CdmUncommittedBackup)
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs File containing dirstate nodeid (the changeset we need
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs to update the workspace to after applying the bundle).
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs This is the node to which the working copy changes
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs (see 'diff', below) will be applied if applicable.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs bundle (handled by CdmCommittedBackup)
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs An Hg bundle containing outgoing committed changes.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs nodes (handled by CdmCommittedBackup)
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs A text file listing the full (hex) nodeid of all nodes in
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs bundle, used by need_backup.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs diff (handled by CdmUncommittedBackup)
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs A Git-formatted diff containing uncommitted changes.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs renames (handled by CdmUncommittedBackup)
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs A list of renames in the working copy that have to be
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs applied manually, rather than by the diff.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs metadata.tar.gz (handled by CdmMetadataBackup)
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs $CODEMGR_WS/.hg/hgrc
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs $CODEMGR_WS/.hg/localtags
377116851d972902caefc86c848359c0273d8487wl $CODEMGR_WS/.hg/patches (Mq data)
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs latest -> generation#
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphs Newest backup generation.
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphsAll files in a given backup generation, with the exception of
0205780bc43902d17f94f07ceacb0cd8d5eab20frralphsdirstate, are optional.
n = name
if parent:
if not parent:
if not out:
if outnodes:
fp = None
except EnvironmentError, e:
except EnvironmentError, e:
e.name)
if f and not f.closed:
f.close()
f.close()
except EnvironmentError, e:
if f and not f.closed:
f.close()
return True
return False
ret = []
return ret
fp = None
except EnvironmentError, e:
except EnvironmentError, e:
except EnvironmentError, e:
fp = None
return dirstate
except EnvironmentError, e:
e.name)
files = {}
if fuzz:
except Exception, e:
except EnvironmentError, e:
except ValueError:
return True
except EnvironmentError, e:
return True
bakrenamed = None
except EnvironmentError, e:
return True
return False
tar = None
error))
except EnvironmentError, e:
tar = None
error))
return True
tarnames = []
return True
return True
return False
backupdir = None
backupbase = None
return name
home = None
except KeyError:
if not home:
return backupdir
except EnvironmentError, e:
return True
if x.need_backup():
return True
return False
except EnvironmentError, e:
x.backup()
except Exception, e:
x.cleanup()
if gen:
x.restore()