是否可以使用TFSAPI在特定日期之间创建变更集?

2024-05-19 11:30:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在编写一个程序,使用Microsoft TFS Python库(TFS API Python客户端)根据创建的日期查找变更集

我仔细阅读了文档,发现get_changesets()方法可以用于此目的。但没有任何参数可以帮助根据日期筛选出变更集

进一步阅读后,我发现可以使用get_tfs_resource(),但由于不熟悉使用API,我无法确定如何设置方法调用的有效负载,这将有助于我使用date筛选变更集

有人可以帮助我使用正确的方法,或者按照规定发送有效负载吗


Tags: 方法文档程序目的api客户端参数get
2条回答

您可以检查以下代码:

from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
import pprint

# Fill in with your personal access token and org URL
personal_access_token = 'YOURPAT'
organization_url = 'https://dev.azure.com/YOURORG'

# Create a connection to the org
credentials = BasicAuthentication('', personal_access_token)
connection = Connection(base_url=organization_url, creds=credentials)

tfsv_client = connection.clients.get_tfvc_client()
project_name="myprojname"
search_criteria = type('',(object,),{"item_path":'$/myprojname/Trunk/Main',"fromDate":'01-01-2019', "toDate":'11-13-2019-2:00PM'})

changeset_info = tfvcclient.get_changesets(project=project_name,search_criteria=search_criteria)

参考资料来源:

相关问题 更多 >

    热门问题