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

基于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.mfbz.cn/a/131901.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Nginx镜像部署

因为需要nginx的初始化配置文件,为了保证不出错, 所以我们直接启动一个nginx容器,把配置文件拉取下来,然后删除容器! 4.1.1、创建nginx工作目录 #需要一个conf文件存放目录,和html文件目录,及日志存放目…

[C++ ]:7.内存管理+模板引入。

内存管理模板引入 一.内存管理:1.内存区域划分图:2.区域划分实例:3.C 内存管理方式:newdelete4.自定义类型的new和delete:一.简单类:二.日期类:三.栈类:四.队列类(栈实现…

RK3568驱动指南|第七篇-设备树-第64章 device_node转换成platform_device实验

瑞芯微RK3568芯片是一款定位中高端的通用型SOC,采用22nm制程工艺,搭载一颗四核Cortex-A55处理器和Mali G52 2EE 图形处理器。RK3568 支持4K 解码和 1080P 编码,支持SATA/PCIE/USB3.0 外围接口。RK3568内置独立NPU,可用于轻量级人工…

Excel 常用技巧

1: 拼接 公式: C1&B1&A1 如 D CBA 将公式输入目标列之后回车即可得到结果 , 如果有多行需要处理 , 光标选中目标单元格右下角变为 按着左键下拉即可 最后选择转换功能转换为文本即可 2: 时间戳转时间格式 公式: TEXT((B2/10008*3600)/8640070*36519,"yyyy/mm…

VC6.0 高亮扩展

输入关键字 "asist vc6.0" 点击网页: https://wws.lanzouj.com/isNmZe9ap2f 几秒后下载成功 在VS2021 安装以下这个扩展 打开vc6.0 代码有高亮了

RustRover里使用AI通义灵码来写代码

AI通义灵码我选择RustRover里的 plugin进行下载使用 然后我们就提问好了&#xff1a;让他用c语言写一个冒泡排序程序 #include <stdio.h>void bubble_sort(int arr[], int size) {int i, j, temp;for (i 0; i < size - 1; i) {for (j 0; j < size - i - 1; j) {i…

Edge浏览器新建标签页如何更改为指定网址

Edge浏览器新建标签页如何更改为指定网址&#xff1f; 启动时新建标签页 不是说启动时&#xff0c;而是加号新建标签页时候 启动时 新建标签页 New Tab Changer 可以了 如果没有需要应用商店下载 参考文章

Clickhouse 学习笔记(6)—— ClickHouse 分片集群

前置知识&#xff1a; Clickhouse学习笔记&#xff08;5&#xff09;—— ClickHouse 副本-CSDN博客 与副本对比&#xff1a; 副本虽然能够提高数据的可用性&#xff0c;降低丢失风险&#xff0c;但是每台服务器实际上必须容纳全量数据&#xff0c;对数据的横向扩容没有解决 …

Windows下Python及Anaconda的安装与设置之保姆指南

学习Python编程需要安装基本的开发环境。 &#xff08;1&#xff09;python ——编译器&#xff1b;这个是任何语言都需要的&#xff1b;必需&#xff01; &#xff08;2&#xff09;Anaconda ——主要的辅助工具&#xff0c;号称是 Python‘OS&#xff1b;必需&#xff01; …

Postman的环境变量和全局变量

近期在复习Postman的基础知识&#xff0c;在小破站上跟着百里老师系统复习了一遍&#xff0c;也做了一些笔记&#xff0c;希望可以给大家一点点启发。 多种环境&#xff1a;开发环境、测试环境、预发布环境、生产环境&#xff0c;可以用环境变量来解决。 今天的分享就到这里&a…

nodejs nvm 环境安装踩坑记录--google镜像chatgpt

nvm-win10 nvm : Node Version Manager : 解决版本匹配问题 nvm-windows 安装nvm-windows 安装完nvm-setup.exe后&#xff0c;以管理员权限重新开一个powershell窗口执行以下命令&#xff1a;&#xff08;否则会报错命令找不到&#xff0c;因为刚刚的nvm-setup.exe更新了系统PA…

为什么继电器上会有多组电压/电流标识

问题 玩过继电器的朋友一定会注意到这么一个细节&#xff0c;大部分的继电器上&#xff0c;都会标有多组电压电流参数&#xff0c;就比如下面的继电器&#xff0c;一共有三组电气参数&#xff1a; 10A 250V AC &#xff08;250V交流情况下&#xff0c;最大电流10A&#xff09;…

内存管理

目录 C/C内存分布 引入 分析 说明 C语言内存管理方式&#xff1a;malloc calloc realloc free malloc realloc calloc 面试题 C内存管理方式 new/delete操作符 用法 new和delete操作自定义类型 operator new和operator delete函数 operator new ​编辑 operator…

HarmonyOS应用开发者高级认证(88分答案)

看好选择题&#xff0c;每个2分多答对2个刚好88分&#xff0c;祝你顺利。 其它帮扶选择题。 一、判断 只要使用端云一体化的云端资源就需要支付费用&#xff08;错&#xff09;所有使用Component修饰的自定义组件都支持onPageShow&#xff0c;onBackPress和onPageHide生命周期…

Postman for Mac(HTTP请求发送调试工具)v10.18.10官方版

Postman for mac是一个提供在MAC设备上功能强大的开发&#xff0c;监控和测试API的绝佳工具。非常适合开发人员去使用。此版本通过Interceptor添加了对请求捕获的支持&#xff0c;修正了使用上下文菜单操作未复制响应正文的问题和预请求脚本的垂直滚动条与自动完成下拉列表重叠…

【算法与数据结构】40、LeetCode组合总和 II

文章目录 一、题目二、解法三、完整代码 所有的LeetCode题解索引&#xff0c;可以看这篇文章——【算法和数据结构】LeetCode题解。 一、题目 二、解法 思路分析&#xff1a;【算法与数据结构】39、LeetCode组合总和的基础之上&#xff0c;这道题变成了candidates中有重复元素&…

mysql索引下推

文章目录 什么是索引下推索引下推优化的原理索引下推的具体实践没有使用ICP使用ICP 总结索引下推使用条件相关系统参数 什么是索引下推 索引下推(Index Condition Pushdown&#xff0c;简称ICP)&#xff0c;是MySQL5.6版本的新特性&#xff0c;它能减少回表查询次数&#xff0…

U-Mail邮箱系统,政务邮箱国产化改造优质之选

近年来&#xff0c;我国电子政务进入了全面铺开快速发展的阶段&#xff0c;政府机构的信息化管理能力也大幅提升。但是&#xff0c;随着国际形势的新变化&#xff0c;国家主管部门陆续出台相关政策&#xff0c;全面指导并要求政府机构落实国产化信息技术建设。因此&#xff0c;…

C++入门篇3(类和对象【重点】)

文章目录 C入门篇3&#xff08;类和对象【重点】&#xff09;1、面向过程和面向对象2、类的引入3、类的定义4、类的访问限定符及封装4.1、访问限定符4.2、封装 5、类的作用域6、类的实例化&#xff08;对象&#xff09;7、类对象模型7.1、类对象的存储方式7.2、结构体&#xff…

模电学习路径--google镜像chatgpt

交流通路实质 列出电路方程1&#xff0c;方程1对时刻t做微分 所得方程1‘ 即为 交流通路 方程1对时刻t做微分&#xff1a;两个不同时刻的方程1相减&#xff0c;并 令两时刻差为 无穷小 微分 改成 差 模电学习路径&#xff1a; 理论 《电路原理》清华大学 于歆杰 朱桂萍 陆文…
最新文章