reconcilepost

RPLib – reconcilepost

RPLib.reconcilepost(Workspace=None, log_folder=None, versions=None, parent_version=None, delete_version=True, all_versions=True, acquire_locks=True, abort_if_conflicts=True, by_object=True, favor_target=True, post=True)[source]

Reconciles a version or multiple versions against a target version.

Parameter Type Description Required
Workspace String Path to SDE connection file. Yes
log_folder String Path to folder where log file(s) will be stored. Yes
versions List List of version names to be reconciled and posted. No
parent_version String

The geodatabase, or version of a geodatabase, which owns the version(s).

  • None = “sde.default” (Default)
  • “” = “sde.default”
No
delete_version Boolean

Indicates if versions will be deleted after posting to target version.

  • True = Delete version after posting to target version. (Default)
  • False = Keep version after posting to target version.
No
all_versions Boolean

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

  • True = Reconciles edit versions with the target version. (Default)
  • False = Reconciles versions that are blocking the target version from compressing.
No
acquire_locks Boolean

Determines whether feature locks will be acquired.

  • True = Should be used when the intention is to post edits. (Default)
  • False = Should be used when the edit version will not be posted to the target version.
No
abort_if_conflicts Boolean

Reconcile will be aborted if conflicts are found between versions.

  • True = Aborts the reconcile if conflicts are found. (Default)
  • False = Does not abort the reconcile if conflicts are found.
No
by_object Boolean

Describes the conditions required for a conflict to occur.

  • True = Any changes to the same row or feature in the parent and child versions will conflict during reconcile. (Default)
  • False = Only changes to the same attribute 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.
No
favor_target Boolean

Describes the behavior if a conflict is detected.

  • True = Resolve in favor of the target version. (Default)
  • False = Resolve in favor of the edit version.
No
post Boolean

Posts the current edit session to the reconciled target version.

  • True = Version will be posted to the target version after the reconcile. (Default)
  • False = Version will not be posted to the target version after the reconcile.
No

Returns: Boolean

Usage

  • Only works with enterprise geodatabases.
  • The reconcile process requires that you have full permissions to all the feature classes that have been modified in the version being edited.
  • 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, all_versions = True, all vesions in the geodatabase will appear the same.

Example 1

Simple call with all parameters specified.

import RPLib

sdeOwner = "C:/GIS/SDEADMIN@GIS.sde"

RPLib.reconcilepost(sdeOwner,"C:/TESTGIS","","sde.DEFAULT",True,True,True,True,True,True,True)

Example 2

Simple call with only required parameters specified.

import RPLib

sdeOwner = "C:/GIS/SDEADMIN@GIS.sde"

RPLib.reconcilepost(sdeOwner,"C:/TESTGIS")

Example 3

If Else logic with all parameters specified.

import RPLib

sdeOwner = "C:/GIS/SDEADMIN@GIS.sde"

if RPLib.reconcilepost(sdeOwner,"C:/TESTGIS","","sde.DEFAULT",True,True,True,True,True,True,True):
    print("successful, run another tool")
else:
    print("failed, run another tool")

Example 4

Notice you do not need to specify these parameters because by default:
  • versions = None - Will gather all versions for the connection file used
  • parent_version = “sde.default”
  • delete_version = True
  • all_versions = True
  • acquire_locks = True
  • abort_if_conflicts = True
  • by_object = True
  • favor_target = True
  • post = True
import RPLib

sdeOwner = "C:/GIS/SDEADMIN@GIS.sde"

if RPLib.reconcilepost(sdeOwner,"C:/TESTGIS"):
    print("successful, run another tool")
else:
    print("failed, run another tool")

Table Of Contents

Previous topic

rebuild_indexes_analyze

Next topic

truncateappend

This Page