Reconcile Versions

Title  Reconcile Versions

Summary

Geoprocessing tool that reconciles a version or multiple versions against a target version.


Usage


Syntax

Parameter Explanation
reconcile_mode

Determines which versions will be reconciled when the tool is executed.

  • ALL_VERSIONS—Reconciles edit versions with the target version. This is the default.
  • BLOCKING_VERSIONS—Reconciles versions that are blocking the target version from compressing. This option uses the recommended reconcile order.
target_version (Optional)

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.

edit_versions (Optional)

Name of the edit version or versions to be reconciled with the selected target version.

Only versions that are in the direct ancestry of the selected target version will be displayed.

acquire_locks (Optional)

Determines whether feature locks will be acquired.

  • Checked—Acquires locks during the reconcile process. This should be used when the intention is to post edits. It ensures that the target version is not modified in the time between the reconcile and post operations. This is the default.
  • Unchecked—No locks are acquired during the reconcile process. This allows multiple users to reconcile in parallel. It should be used when the edit version will not be posted to the target version because there is a possibility that the target version could be modified in the time between the reconcile and post operations.
abort_if_conflicts (Optional)

Determines if the reconcile process should be aborted if conflicts are found between the target version and the edit version.

  • Checked—Aborts the reconcile if conflicts are found.
  • Unchecked—Does not abort the reconcile if conflicts are found. This is the default.
conflict_definition (Optional)

Describes the conditions required for a conflict to occur:

  • BY_OBJECT—Any changes to the same row or feature in the parent and child versions will conflict during reconcile. This is the default.
  • BY_ATTRIBUTE—Only changes to the same attribute (column) of the same row or feature in the parent and child versions will be flagged as a conflict during reconcile. Changes to different attributes will not be considered a conflict during reconcile.
conflict_resolution (Optional)

Describes the behavior if a conflict is detected:

  • FAVOR_TARGET_VERSION—For all conflicts, resolves in favor of the target version. This is the default.
  • FAVOR_EDIT_VERSION—For all conflicts, resolves in favor of the edit version.
with_post (Optional)

Posts the current edit session to the reconciled target version.

  • Checked—Current edit version will be posted to the target version after the reconcile.
  • Unchecked—Current edit version will not be posted to the target version after the reconcile. This is the default.
with_delete (Optional)

When the post option is set to POST the option to delete versions becomes active.

  • Checked—Current edit version that was reconciled will be deleted after being posted to the target version.
  • Unchecked—Current edit version that was reconciled will not be deleted. This is the default.
out_log (Optional)

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.

Code Samples

ReconcileVersions example (stand-alone script):


# Name: ReconcileVersions.py
# Description: Reconciles all versions owned by a user with SDE.Default

# Import system modules
import arcpy, os

# Set workspace
workspace = 'C:/Data/connections/[email protected]'

# Set the workspace environment
arcpy.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')

                    

Tags

Credits

Use limitations