Reconcile Versions (データ管理)
サマリ
Reconciles a version or multiple versions against a target version.
使用法
-
The reconcile process requires that you are the only user currently editing the version and the only user able to edit the version throughout the reconcile process until you save or post.
The reconcile process requires that you have full permissions to all the feature classes that have been modified in the version being edited.
Versioning tools only work with Enterprise (ArcSDE) Geodatabases. File and Personal geodatabases don't support versioning.
The geodatabase is designed to efficiently manage and support long transactions using versions.
The reconcile process detects differences between the edit version and the target version and flags these differences as conflicts. If conflicts exist, they should be resolved.
After running the reconcile process successfully with the 'ALL_VERSIONS' option all vesions in the geodatabase will appear the same.
構文
パラメータ | 説明 | データ タイプ |
input_database |
The enterprise geodatabase that contains the versions to be reconciled. The default is to use the workspace defined in the environment. | Workspace |
reconcile_mode |
Determines which versions will be reconciled when the tool is executed.
| String |
target_version (オプション) |
Name of any version in the direct ancestry of the an edit version, such as the parent version or the default version. Typically contains edits from other versions that the user performing the reconcile would like to pull into their edit version. | String |
edit_versions [edit_versions,...] (オプション) | Name of the edit version or versions to be reconciled with the selected target version. This can be an individual version name or a Python list of version names. | String |
acquire_locks (オプション) |
Determines whether feature locks will be acquired.
| Boolean |
abort_if_conflicts (オプション) |
Determines if the reconcile process should be aborted if conflicts are found between the target version and the edit version.
| Boolean |
conflict_definition (オプション) |
Describes the conditions required for a conflict to occur:
| Boolean |
conflict_resolution (オプション) |
Describes the behavior if a conflict is detected:
| String |
with_post (オプション) |
Posts the current edit session to the reconciled target version.
| Boolean |
with_delete (オプション) |
| Boolean |
out_log (オプション) |
Specify a name and location to where the log file will be written. The log file is an ASCII file containing the contents of the geoprocessing messages. | File |
コードのサンプル
The following stand-alone script demonstrates how to use the ReconcileVersions tool to reconcile all versions owned by the user specified in the SDE connection file.
# Name: ReconcileVersions.py
# Description: Reconciles all versions owned by a user with SDE.Default
# Import system modules
import arcpy, os
from arcpy import env
# Set workspace
workspace = 'Database Connections//bender@production.sde'
# Set the workspace environment
env.workspace = workspace
# Use a list comprehension to get a list of version names where the owner
# is the current user and make sure sde.default is not selected.
verList = [ver.name for ver in arcpy.da.ListVersions() if ver.isOwner
== True and ver.name.lower() != 'sde.default']
arcpy.ReconcileVersions_management(workspace,
"ALL_VERSIONS",
"SDE.Default",
verList,
"LOCK_ACQUIRED",
"NO_ABORT",
"BY_OBJECT",
"FAVOR_TARGET_VERSION",
"NO_POST",
"KEEP_VERSION",
"c:\RecLog.txt")
print 'Reconciling Complete'