Fossil SCM

Make the merge command behave as if --cherrypick were passed in if merge is invoked with the name cherry-pick, per [forum:/forumpost/7ca2e5dc4c | forum post 7ca2e5dc4c] and /chat discussion. Fixed an unrelated internal doc typo.

stephan 2022-01-05 23:26 trunk
Commit 0421108812a73ca16acd929f5485360f5d21ff2a72e94e00b4a633e7f8a43d56
2 files changed +6 -1 +1 -1
+6 -1
--- src/merge.c
+++ src/merge.c
@@ -274,20 +274,22 @@
274274
}
275275
276276
277277
/*
278278
** COMMAND: merge
279
+** COMMAND: cherry-pick
279280
**
280281
** Usage: %fossil merge ?OPTIONS? ?VERSION?
281282
**
282283
** The argument VERSION is a version that should be merged into the
283284
** current checkout. All changes from VERSION back to the nearest
284285
** common ancestor are merged. Except, if either of the --cherrypick or
285286
** --backout options are used only the changes associated with the
286287
** single check-in VERSION are merged. The --backout option causes
287288
** the changes associated with VERSION to be removed from the current
288
-** checkout rather than added.
289
+** checkout rather than added. When invoked with the name cherry-pick,
290
+** this command works exactly like merge --cherrypick.
289291
**
290292
** If the VERSION argument is omitted, then Fossil attempts to find
291293
** a recent fork on the current branch to merge.
292294
**
293295
** Only file content is merged. The result continues to use the
@@ -364,10 +366,13 @@
364366
forceMissingFlag = find_option("force-missing",0,0)!=0;
365367
if( !verboseFlag ){
366368
verboseFlag = find_option("detail",0,0)!=0; /* deprecated */
367369
}
368370
pickFlag = find_option("cherrypick",0,0)!=0;
371
+ if(0==fossil_strcmp("cherry-pick", g.zCmdName)){
372
+ pickFlag = 1;
373
+ }
369374
integrateFlag = find_option("integrate",0,0)!=0;
370375
backoutFlag = find_option("backout",0,0)!=0;
371376
zBinGlob = find_option("binary",0,1);
372377
dryRunFlag = find_option("dry-run","n",0)!=0;
373378
if( !dryRunFlag ){
374379
--- src/merge.c
+++ src/merge.c
@@ -274,20 +274,22 @@
274 }
275
276
277 /*
278 ** COMMAND: merge
 
279 **
280 ** Usage: %fossil merge ?OPTIONS? ?VERSION?
281 **
282 ** The argument VERSION is a version that should be merged into the
283 ** current checkout. All changes from VERSION back to the nearest
284 ** common ancestor are merged. Except, if either of the --cherrypick or
285 ** --backout options are used only the changes associated with the
286 ** single check-in VERSION are merged. The --backout option causes
287 ** the changes associated with VERSION to be removed from the current
288 ** checkout rather than added.
 
289 **
290 ** If the VERSION argument is omitted, then Fossil attempts to find
291 ** a recent fork on the current branch to merge.
292 **
293 ** Only file content is merged. The result continues to use the
@@ -364,10 +366,13 @@
364 forceMissingFlag = find_option("force-missing",0,0)!=0;
365 if( !verboseFlag ){
366 verboseFlag = find_option("detail",0,0)!=0; /* deprecated */
367 }
368 pickFlag = find_option("cherrypick",0,0)!=0;
 
 
 
369 integrateFlag = find_option("integrate",0,0)!=0;
370 backoutFlag = find_option("backout",0,0)!=0;
371 zBinGlob = find_option("binary",0,1);
372 dryRunFlag = find_option("dry-run","n",0)!=0;
373 if( !dryRunFlag ){
374
--- src/merge.c
+++ src/merge.c
@@ -274,20 +274,22 @@
274 }
275
276
277 /*
278 ** COMMAND: merge
279 ** COMMAND: cherry-pick
280 **
281 ** Usage: %fossil merge ?OPTIONS? ?VERSION?
282 **
283 ** The argument VERSION is a version that should be merged into the
284 ** current checkout. All changes from VERSION back to the nearest
285 ** common ancestor are merged. Except, if either of the --cherrypick or
286 ** --backout options are used only the changes associated with the
287 ** single check-in VERSION are merged. The --backout option causes
288 ** the changes associated with VERSION to be removed from the current
289 ** checkout rather than added. When invoked with the name cherry-pick,
290 ** this command works exactly like merge --cherrypick.
291 **
292 ** If the VERSION argument is omitted, then Fossil attempts to find
293 ** a recent fork on the current branch to merge.
294 **
295 ** Only file content is merged. The result continues to use the
@@ -364,10 +366,13 @@
366 forceMissingFlag = find_option("force-missing",0,0)!=0;
367 if( !verboseFlag ){
368 verboseFlag = find_option("detail",0,0)!=0; /* deprecated */
369 }
370 pickFlag = find_option("cherrypick",0,0)!=0;
371 if(0==fossil_strcmp("cherry-pick", g.zCmdName)){
372 pickFlag = 1;
373 }
374 integrateFlag = find_option("integrate",0,0)!=0;
375 backoutFlag = find_option("backout",0,0)!=0;
376 zBinGlob = find_option("binary",0,1);
377 dryRunFlag = find_option("dry-run","n",0)!=0;
378 if( !dryRunFlag ){
379
+1 -1
--- src/repolist.c
+++ src/repolist.c
@@ -256,11 +256,11 @@
256256
db_open_repository(zSkinRepo);
257257
fossil_free(zSkinRepo);
258258
fossil_free(zSkinUrl);
259259
}
260260
if( g.repositoryOpen ){
261
- /* This case runs if remote_repository_info() found a repository
261
+ /* This case runs if remote_repo_info() found a repository
262262
** that has the "repolist_skin" property set to non-zero and left
263263
** that repository open in g.db. Use the skin of that repository
264264
** for display. */
265265
login_check_credentials();
266266
style_set_current_feature("repolist");
267267
--- src/repolist.c
+++ src/repolist.c
@@ -256,11 +256,11 @@
256 db_open_repository(zSkinRepo);
257 fossil_free(zSkinRepo);
258 fossil_free(zSkinUrl);
259 }
260 if( g.repositoryOpen ){
261 /* This case runs if remote_repository_info() found a repository
262 ** that has the "repolist_skin" property set to non-zero and left
263 ** that repository open in g.db. Use the skin of that repository
264 ** for display. */
265 login_check_credentials();
266 style_set_current_feature("repolist");
267
--- src/repolist.c
+++ src/repolist.c
@@ -256,11 +256,11 @@
256 db_open_repository(zSkinRepo);
257 fossil_free(zSkinRepo);
258 fossil_free(zSkinUrl);
259 }
260 if( g.repositoryOpen ){
261 /* This case runs if remote_repo_info() found a repository
262 ** that has the "repolist_skin" property set to non-zero and left
263 ** that repository open in g.db. Use the skin of that repository
264 ** for display. */
265 login_check_credentials();
266 style_set_current_feature("repolist");
267

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button