基于subversion1.6.3动态库实现简单版本管理

news2024/10/7 4:36:26

基于subversion1.6.3动态库实现简单版本管理

一、运行环境

  • windows10 64位系统

在这里插入图片描述

二、功能设计与实现

1、需求背景

2、技术选型

参考 文章

3、程序设计

3.1、需要实现的功能

  • 可指定版本Checkout

  • 可指定版本Update

  • 查询版本信息(支持本地workcopy版本及svn上版本信息)

3.2、调用实现

  • svn库函数调用基本流程

在这里插入图片描述

  • 准备svn-clent-context流程

在这里插入图片描述

4、功能实现

4.1、Checkout

  • 调用函数

svn_error_t *
svn_client_checkout3(svn_revnum_t *result_rev,
                     const char *URL,
                     const char *path,
                     const svn_opt_revision_t *peg_revision,
                     const svn_opt_revision_t *revision,
                     svn_depth_t depth,
                     svn_boolean_t ignore_externals,
                     svn_boolean_t allow_unver_obstructions,
                     svn_client_ctx_t *ctx,
                     apr_pool_t *pool);
result_rev:如果参数不为空,返回当前版本信息即WC Version;
URL:要checkout的svn url路径;
path:本地目录
peg_revision:根据资料来看,跟extern外部引用trunk有关,跟revision一样即可;
revision:指定要checkout的版本;
depth:checkout目录层数,一般设置svn_depth_infinity全部获取
ignore_externals:忽略外部链接版本,即tsvn客户端的omit externals,一般设置false
allow_unver_obstructions:false即可;
ctx:client ctx;
pool:apr pool;

参考资料

If neither revision is specified, it is effectively an operative revision of HEAD. In that case, the search starts with the HEAD of the repo, it THEN gets the path. If the path doesn't exist in the HEAD, it won't be found, resulting in a path not found error. The extern needs to start the search with a revision where the path existed - a peg revision can do just that.

I always set the peg revision for my externals to ensure that if I checkout a particular revision of the main repo, I'm always building the same code. Without a specified revision for the extern, checking out the same revision from the main repo at different times will generate different results (because the externs could be different).

As I said, the Subversion Red Book probably explains it better than me, and there's always the risk that I'm wrong. [However, it is based on having a similar issue and trying to overcome it.]

HTH,
Bruce


This email and any attachments or links herein are confidential and may contain Metrol Technology Limited proprietary information that is legally privileged or otherwise protected from disclosure. It is solely intended for the person(s) named above. If you are not the intended recipient, any reading, use, disclosure, copying or distribution of all or parts of this email or associated attachments or links to other web locations, is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by replying to this message or by telephone and delete this email and any attachments or links permanently from your system. Metrol accepts no liability for any damage of whatever nature caused by this email.

在这里插入图片描述

  • Checkout过程信息获取

设置回调函数notify_func或notify_func2
#
pCtxActual->notify_func = (svn_wc_notify_func_t)CActionCheckout::notify_func;
#
void* CActionCheckout::notify_func(void *baton,
	const char *path,
	svn_wc_notify_action_t action,
	svn_node_kind_t kind,
	const char *mime_type,
	svn_wc_notify_state_t content_state,
	svn_wc_notify_state_t prop_state,
	svn_revnum_t revision) {
	//打印checkout文件信息
	CLogger4Cpp::GetInstance()->Debug("checkout %s", path);
	//
	return NULL;
}

4.2、Update

  • 调用函数

svn_error_t *
svn_client_update3(apr_array_header_t **result_revs,
                   const apr_array_header_t *paths,
                   const svn_opt_revision_t *revision,
                   svn_depth_t depth,
                   svn_boolean_t depth_is_sticky,
                   svn_boolean_t ignore_externals,
                   svn_boolean_t allow_unver_obstructions,
                   svn_client_ctx_t *ctx,
                   apr_pool_t *pool);
  • Update过程信息获取

设置回调函数notify_func或notify_func2
#
pCtxActual->notify_func = (svn_wc_notify_func_t)checkout::notify_func;
#
void* checkout::notify_func(void *baton,
	const char *path,
	svn_wc_notify_action_t action,
	svn_node_kind_t kind,
	const char *mime_type,
	svn_wc_notify_state_t content_state,
	svn_wc_notify_state_t prop_state,
	svn_revnum_t revision) {
	//打印Update文件信息
	CLogger4Cpp::GetInstance()->Debug("update %s", path);
	//
	return NULL;
}

4.3 Info

  • 调用函数

svn_error_t *
svn_client_info2(const char *path_or_url,
                 const svn_opt_revision_t *peg_revision,
                 const svn_opt_revision_t *revision,
                 svn_info_receiver_t receiver,
                 void *receiver_baton,
                 svn_depth_t depth,
                 const apr_array_header_t *changelists,
                 svn_client_ctx_t *ctx,
                 apr_pool_t *pool);
如果peg_revision跟revision设置为NULL,查询获取的是本地副本的信息,这个也才是一般情况比较关心的,否则就获取svn版本上的信息;
  • Info版本信息获取

#
svn_error_t *CActionInfo::svn_info_receiver_t
(void *baton,
	const char *path,
	const svn_info_t *info,
	apr_pool_t *pool) {
	//
	CActionInfo* pParent = NULL;
	//
	if (baton == NULL) {
		goto exit;
	}
	if (info == NULL) {
		goto exit;
	}
	//
	pParent = (CActionInfo*)(baton);
      //
	pParent->m_workCopyVersion = info->last_changed_rev;
	//
	exit: return NULL;
}

三、运行效果

  • 界面展示

在这里插入图片描述

四、附件下载

基于subversion1.6.3动态库实现简单版本管理.rar (访问密码: 1150)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1196418.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

GPU CUDA 使用shared memory 运行速度不升反降原因与解决方案

写了两张图像相加&#xff0c;以及图像滤波的的几个算子&#xff0c;分别采用shared memory 进行优化。 #include <stdio.h> #include <cuda_runtime.h>#include "helper_cuda.h" #include "helper_timer.h"#define BLOCKX 32 #define BLOCKY…

【C语言 | 预处理】C语言预处理详解(三)——内存对齐、手把手带你计算结构体大小

&#x1f601;博客主页&#x1f601;&#xff1a;&#x1f680;https://blog.csdn.net/wkd_007&#x1f680; &#x1f911;博客内容&#x1f911;&#xff1a;&#x1f36d;嵌入式开发、Linux、C语言、C、数据结构、音视频&#x1f36d; &#x1f923;本文内容&#x1f923;&a…

2023年加氢工艺证考试题库及加氢工艺试题解析

题库来源&#xff1a;安全生产模拟考试一点通公众号小程序 2023年加氢工艺证考试题库及加氢工艺试题解析是安全生产模拟考试一点通结合&#xff08;安监局&#xff09;特种作业人员操作证考试大纲和&#xff08;质检局&#xff09;特种设备作业人员上岗证考试大纲随机出的加氢…

DDU框架学习之路

目录 MVVM对比 DDU 数据消费者UI 数据的转换者&#xff1a;Domain Layer 数据图生产者/提供者 DataLayer 遵循原理&#xff1a; 单一数据流&#xff1a; Android官方推荐架构&#xff1a;DDU MVVM对比 M&#xff1a;Model 网络层 用于获取远端数据 VM:ViewModel 中间转…

【Shell脚本9】Shell test 命令

Shell test 命令 Shell中的 test 命令用于检查某个条件是否成立&#xff0c;它可以进行数值、字符和文件三个方面的测试。 数值测试 num1100 num2100 if test $[num1] -eq $[num2] thenecho 两个数相等&#xff01; elseecho 两个数不相等&#xff01; fi输出结果&#xff1a…

关于Android Studio 同步Gradle失败的解决方案

&#xff08;1&#xff09;打开Android Studio的Settings找到Gradle的目录 &#xff08;2&#xff09;打开本地文件目录&#xff0c;找到对应的gradle版本&#xff0c;可以通过Index of /gradle/ 下载gradle压缩包。把目录中gradle-7.0.2-bin\一堆字符\ 下 的.lck 和.part文…

Oracle(16)Managing Privileges

目录 一、基础知识 1、Managing Privileges管理权限 2、System Privileges 系统特权 3、System Privileges : Example系统权限&#xff1a;示例 4、Who Can Grant or Revoke? 谁可以授予或撤销权限&#xff1f; 5、The PUBLIC 6、SYSDBA and SYSOPER 7、Revoke with A…

KT6368A蓝牙芯片的出现部分芯片距离短换芯片就好是什么问题呢

一、简介 KT6368A蓝牙芯片的出现部分芯片距离短&#xff0c;换一个芯片距离就好了&#xff0c;是什么问题呢&#xff1f;生产2K的样子 详细说明 按照我们出货客户的跟踪情况&#xff0c;这种问题&#xff0c;可能性极低因为芯片本身的不良率&#xff0c;目前是控制在千分之三…

js 求数组中的对象某个属性和

可以直接看下效果 代码&#xff1a; <script>let list [{num: 1,price: 10,},{num: 2,price: 10,},{num: 3,price: 10,},{num: 4,price: 10,},]// for循环 求总数和 num的和let num 0for (let i 0; i < list.length; i) {num list[i].num}console.log(第一种&am…

深度学习 python opencv 火焰检测识别 计算机竞赛

文章目录 0 前言1 基于YOLO的火焰检测与识别2 课题背景3 卷积神经网络3.1 卷积层3.2 池化层3.3 激活函数&#xff1a;3.4 全连接层3.5 使用tensorflow中keras模块实现卷积神经网络 4 YOLOV54.1 网络架构图4.2 输入端4.3 基准网络4.4 Neck网络4.5 Head输出层 5 数据集准备5.1 数…

《红蓝攻防对抗实战》九.内网穿透之利用GRE协议进行隧道穿透

​ 前文推荐&#xff1a; 《红蓝攻防对抗实战》一. 隧道穿透技术详解 《红蓝攻防对抗实战》二.内网探测协议出网之TCP/UDP协议探测出网 《红蓝攻防对抗实战》三.内网探测协议出网之HTTP/HTTPS协议探测出网 《红蓝攻防对抗实战》四.内网探测协议出网之ICMP协议探测出网 《红蓝…

AI:86-基于深度学习的人体姿态估计与运动分析

🚀 本文选自专栏:人工智能领域200例教程专栏 从基础到实践,深入学习。无论你是初学者还是经验丰富的老手,对于本专栏案例和项目实践都有参考学习意义。 ✨✨✨ 每一个案例都附带有在本地跑过的代码,详细讲解供大家学习,希望可以帮到大家。欢迎订阅支持,正在不断更新中,…

数据结构线性表——带头双向循环链表

前言&#xff1a;小伙伴们好久不见啦&#xff0c;上篇文章我们一起学习了数据结构线性表其一的单链表&#xff0c;了解了单链表的不少好处&#xff0c;但是不可能有完美的数据结构&#xff0c;就算是单链表&#xff0c;也会有很多缺点。 那么今天这篇文章&#xff0c;我们就来…

全网最细,Apipost接口自动化测试-关联配置,老鸟带你上高速...

目录&#xff1a;导读 前言一、Python编程入门到精通二、接口自动化项目实战三、Web自动化项目实战四、App自动化项目实战五、一线大厂简历六、测试开发DevOps体系七、常用自动化测试工具八、JMeter性能测试九、总结&#xff08;尾部小惊喜&#xff09; 前言 在接口自动化测试…

Arduino到底适不适合做产品

文章目录 一、Arduino性能很低&#xff0c;不如树莓派等开发板&#xff0c;所以不要用Arduino做开发二、Arduino程序效率很低&#xff0c;所以不要用Arduino做开发三、Arduino只能开发玩具&#xff0c;不能做产品四、Arduino开发板成本太高&#xff0c;不适合做产品总结个人见解…

iPhone或在2024开放第三方应用商店。

iPhone或开放第三方应用商店&#xff0c;可以说这是一个老生常谈的话题。对于像是iOS这样封闭的系统来说&#xff0c;此前传出苹果可能开放侧载消息的时候&#xff0c;又有谁能信&#xff0c;谁会信&#xff1f; 如果是按照苹果自身的意愿&#xff0c;这种事情自然是不可能发生…

【LeetCode笔试题】88.合并两个有序数组

问题描述 给你两个按 非递减顺序 排列的整数数组 nums1 和 nums2&#xff0c;另有两个整数 m 和 n &#xff0c;分别表示 nums1 和 nums2 中的元素数目。 请你 合并 nums2 到 nums1 中&#xff0c;使合并后的数组同样按 非递减顺序 排列。 注意&#xff1a;最终&#xff0c;合…

王学岗visibility改变后调用onLayout()

自定义控件的时候发现了一个bug。 Button位移动画执行结束后我设置了一个不相关的TextView的可见性由gone变为visible.令人郁闷的是&#xff0c;只要我注释的地方放开。动画执行结束后button都会重新绘制在位移动画开始的位置。注释掉这段代码就正常。 经过分析后得知 View的Vi…

python OrderedDict类(有序字典)

嗨喽~大家好呀&#xff0c;这里是魔王呐 ❤ ~! python更多源码/资料/解答/教程等 点击此处跳转文末名片免费获取 创建有序字典 import collectionsdic collections.OrderedDict() dic[k1] v1 dic[k2] v2 dic[k3] v3 print(dic)#输出&#xff1a;OrderedDict([(k1, v1), (…

Vatee万腾科技决策力的未来展望:开创数字化创新的新高度

随着科技不断演进&#xff0c;Vatee万腾的科技决策力在数字化创新领域展现出了强大的潜力和前瞻性。 Vatee万腾的科技决策力被视为数字化创新的引擎&#xff0c;为未来创新注入了新的动力。通过深刻的市场洞察和科学决策&#xff0c;Vatee万腾致力于推动数字化创新走向新的高度…