ListVersions

730
12
06-16-2010 05:52 PM
TedCronin
MVP Honored Contributor
So, is it possible to use ListVersions to list out all the versions as part of a list, have some versions removed from the list, and then proceed to process the list for say a ReconcileVersion_management.  It seems like this should work.

import arcpy

versionList = arcpy.ListVersions ('Database Connections\zzzyyyxxx_tcronin@sdemapper@ACR-GIS2@TestServer.sde')


versionList.remove ('dbo.DEFAULT')
versionList.remove ('ACR_FINAL.Master')

for version in versionList:
    print version



Printed Shows me:

AVATCHAR.NopeTest
MIHILLIG.Shared_AOI_Michael
ACR_GIS.bk111_Jesusa
ACR_GIS.bk222_Jesusa

If i then un comment reconcile above and then run:


RuntimeError: ERROR 087494: Object: Error in executing tool
File "C:\Documents and Settings\tcronin\Desktop\BatchVersionReconcile.py", line 11, in <module>
  arcpy.ReconcileVersion_management (versionList, version, 'ACR_FINAL.Master', "BY_OBJECT", "FAVOR_TARGET_VERSION", "NO_LOCK_AQUIRED", "NO_ABORT", "NO_POST")
File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 9000, in ReconcileVersion
  raise e


If I manually run this tool, I can not see all the versions I want to reconcile, it seems like it is sde connection version specific, but a ListVersion does show me everything, so why is that the case.  Or should I be running this directly in ArcMap, instead of wing.

Wow, Management.py has 9221 lines of code, thats a lot of writing.;)
0 Kudos
12 Replies
TedCronin
MVP Honored Contributor
So, I filed this with Support.  I tested the setup with a 2003 Server with the non standard esri setup (the standard python setup), and was successful in completing everything as expected, so now I think it may be related to XP 64.  It currently generates a crash with only ListVersions, so far, other lists work as expected at least a few that have been tested.
0 Kudos
TedCronin
MVP Honored Contributor
0 Kudos
RussellBrennan
Esri Contributor
Ted,

I worked with Kevin from the GP team on this and we were able to  determine that this is only happening when you run this from a script.  If you step through the commands it will work fine. There is definitely a  bug here and we are trying to figure out the cause and another  workaround besides stepping through it. I can't make any promises but I  am hoping we will get this fixed for SP1.

Kevin will be taking the lead on this so I am going to go ahead and close out this thread. You can continue to discuss this in the GP forum. Kevin hopes to have a NIM number for your reference shortly.
0 Kudos