1 jim.wunderlich 1.1 #//%2006////////////////////////////////////////////////////////////////////////
2 #//
3 #// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 #// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 #// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
6 #// IBM Corp.; EMC Corporation, The Open Group.
7 #// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 #// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
9 #// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 #// EMC Corporation; VERITAS Software Corporation; The Open Group.
11 #// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 #// EMC Corporation; Symantec Corporation; The Open Group.
13 #//
14 #// Permission is hereby granted, free of charge, to any person obtaining a copy
15 #// of this software and associated documentation files (the "Software"), to
16 #// deal in the Software without restriction, including without limitation the
17 #// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 #// sell copies of the Software, and to permit persons to whom the Software is
19 #// furnished to do so, subject to the following conditions:
20 #//
21 #// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 jim.wunderlich 1.1 #// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 #// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 #// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 #// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 #// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 #// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 #// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 #//
30 #//==============================================================================
31
32 # ============================================================================
33 # File Specific coding convention
34 # ====================================
35 #
36 # There are to levels of usage statements supported within this Makefile.
37 # They are usage and usage_all. These are both implemented by doing a search
38 # across the file for 3 or 2 consecutive # charecters.
39 #
40 # This means all comments not to be dispalyed as part of these usae statements
41 # must be made with a single # charecter.
42 #
43 jim.wunderlich 1.1 # ============================================================================
44
45 ### =========================================================================
46 ###
47 ### Makefile for managing a Pegasus source task branch
48 ###
49 ### Refer to OpenPegasus PEP108 and PEP 248 for more information about
50 ### OpenPegasus use of task branches and processes within OpenPegasus
51 ###
52 ### NOTE:
53 ### This is a Preliminary version for testing.
54 ### The Module is set to junk rather than pegasus
55 ### This has not been tested on Windows
56 ###
57 ## Author: Jim Wunderlich (Jim_Wunderlich@prodigy.net)
58 ##
59 ### ========================================================================
60 ###
61 ### General Guidelines:
62 ### Mnay of the rules will operate from any directory while others require
63 ### them to be executed at a specific directory. The commands that require a
64 jim.wunderlich 1.1 ### a specific location will return an error if they are not executed at the
65 ### appropriate directory. Here are specifics:
66 ###
67 ### The following are directory position independent.
68 ### branch_create, branch_delete, branch_rename
69 ### branch_lists, usage usage_all
|
71 jim.wunderlich 1.1 ### branch_diff_unmerged_branch,
72 ### branch_diff_unmerged_trunk
73 ###
74 ### The following should be excuted from above the $(MODULE) directory.
75 ### Note that some of these commands instantiate the working copy of the
76 ### branch source tree(They have a * before and after them ).
77 ### * branch_checkout *, branch_status
78 ### * branch_merge_in *, branch_merge_in_commit, branch_merge_in_finish
79 ### * branch_merge_out *, branch_merge_out_commit, branch_merge_out_finish
80 ### * branch_migrate *, branch_migrate_commit, branch_migrate_finish
81 ###
82 ### The following can be executed from anyware within a working branch
83 ### source tree.
84 ### branch_commit, branch_diff
85 ###
86 ### These rules all depend on the user having already logged into cvs with
87 ### appropriate user permissions.
88 ###
89 ### These rules do not set or maintain cvs defaults. All cvs defaults should
90 ### come from the users's .cvsrc file. These rules set specific options that
91 ### are required for the operation to be performed.
92 jim.wunderlich 1.1 ###
93 ###
94 ## Functions:
95 ## usage
96 ## usage_all
97 ## defaults
98 ##
99 ## branch_list
100 ## branch_status
101 ## branch_create
102 ## branch_rename
103 ## branch_delete
|
110 jim.wunderlich 1.1 ## branch_merge_in
111 ## branch_merge_out
112 ## branch_migrate
113 ##
114 ## ==========================================================================
115 ##
116 ## Tags created/maintained to manage the task branch by the rules within this Makefile
117 ##
118 ## The [BRANCH NAME] is expected to be PEP number like PEP_XXX or
119 ## BUG number like BUG_XXXX and functionality based like like
120 ## PEP_XXX_Config_Changes or BUG_XXXX_Config_changes.
121 ##
122 ##
123 ## Branch and branch management tag naming convention
124 ##
125 ## TASK-[BRANCH_NAME]-[ACTION]_[DIRECTION]_[LOCATION]
126 ##
127 ## Where:
128 ## TASK - is constant to associate all tags to a TASK branch
129 ## BRANCH_NAME - is the name of the branch as described above.
130 ## ACTION - is the action or purpose of the tag. It is one of the following:
131 jim.wunderlich 1.1 ## root, branch, merged_in, merged_out, merging_in or merging_out.
132 ## DIRECTION - is the direction of the ACTION relative to the LOCATION.
133 ## LOCATION - is the associated location of the tag. It is either on the trunk
134 ## or branch.
135 ## Note that the ACTION root does not have a DIRECTION or LOCATION
136 ## as it is always on the trunk. This also means that task branches
137 ## do not support sub branches.
138 ## Note that the ACTION branch does not have a DIRECTION or LOCATION
139 ## as it is the branch.
140 ##
141 ## (1) TASK-[BRANCH NAME]-root - tag on trunk representing the
142 ## root of the branch.
143 ##
144 ## (2) TASK-[BRANCH NAME]-branch - head of the branch
145 ##
146 ##
147 ## (3) TASK-[BRANCH NAME]-merged_out_from_trunk - The tag on the trunk which
148 ## marks the place where the last merge out operation occurred.
149 ## It could also be said that changes on the trunk up
150 ## to this label are contained on the branch.
151 ##
152 jim.wunderlich 1.1 ## (4) TASK-[BRANCH NAME]-merged_out_to_branch - The tag on the branch which
153 ## marks the place where the last merge out operation occurred.
154 ##
155 ## (5) TASK-[BRANCH NAME]-merged_in_to_trunk - The tag on the trunk which
156 ## marks the place where the last merge in operation occurred.
157 ##
158 ## (6) TASK-[BRANCH NAME]-merged_in_from_branch - The tag on the branch which
159 ## marks the place where the last merge in operation occurred.
160 ## It could also be said that changes on the branch up to
161 ## this label have been merged into the trunk.
162 ##
163 ##
164 ## For Example if the branch name is PEPXX_FUNC then the following tags will
165 ## be in use:
166 ## TASK-PEPXX_FUNC-root
167 ## TASK-PEPXX_FUNC-branch
168 ## TASK-PEPXX_FUNC-merged_in_to_trunk
169 ## TASK-PEPXX_FUNC-merged_out_from_trunk
170 ## TASK-PEPXX_FUNC-merged_in_from_branch
171 ## TASK-PEPXX_FUNC-merged_out_to_branch
172 ##
173 jim.wunderlich 1.1 ##
174 ## Consider the following diagram:
175 ##
176 ## NOTE: The numbers in these diagrams refer to the branch maintainence
177 ## symbols above.
178 ##
179 ## After task branch has been created, and changes have been made on both
180 ## the trunk and the branch.
181 ##
182 ## ------------------------------------------------------HEAD
183 ## /
184 ## /
185 ## |
186 ## |
187 ## X--------------------------------------------------------BRANCH (2)
188 ##
189 ## X = 1 = 3 = 4 = 5 = 6
190 ##
191 ##
192 ## After task branch has been merged out once
193 ## and more changes have been made on both the trunk and the branch.
194 jim.wunderlich 1.1 ##
195 ##
196 ## ----Y--------------------------------------------------HEAD
197 ## / \
198 ## / \
199 ## | _\/
200 ## | \
201 ## X-----------Z---------------------------------------------BRANCH (2)
202 ##
203 ## X = 1 = 5 = 6
204 ## Y = 3
205 ## Z = 4
206 ##
207 ##
208 ## After task branch has been merged out several times, merged in once
209 ## and more changes have been made on both the trunk and the branch.
210 ##
211 ## ---------------------Y------------V---------------------HEAD
212 ## / \ \ \ _/
213 ## / \ \ \ /|
214 ## | _\/ _\/ _\/ /
215 jim.wunderlich 1.1 ## | \ \ \ /
216 ## X----------------------------Z--U--------------------------BRANCH (2)
217 ##
218 ## X = 1
219 ## Y = 3
220 ## Z = 4
221 ## U = 6
222 ## V = 5
223 ##
224 ## After branch has been merged out several times, merged in several times
225 ## and more changes have been made on both the trunk and the branch.
226 ##
227 ## -------------------------------------Y-----------V-------HEAD
228 ## / \ \ \ _/ \ _/
229 ## / \ \ \ /| \ /|
230 ## | _\/ _\/ _\/ / _\/ /
231 ## | \ \ \ / \ /
232 ## X--------------------------------------------Z-U-----------BRANCH (2)
233 ##
234 ## X = 1
235 ## Y = 3
236 jim.wunderlich 1.1 ## Z = 4
237 ## U = 6
238 ## V = 5
239 ##
240 ## ==========================================================================
241
242 # ===========================================================================
243 # Area to specifiy include files
244 # ===========================================================================
245
246
247
248 # ===========================================================================
249 # Area to define commands that are platform dependent.
250 #
251 # If these are already set, by a file previously included, then they will not be
252 # set here. In either case it will be verified that the command is on the search
253 # path.
254 #
255 # ===========================================================================
256 # pathsearch = $(firstword $(wildcard $(addsuffix /$(1),$subst :, ,$(PATH))))
257 jim.wunderlich 1.1
258 pathsearch = $(firstword $(wildcard $(addsuffix /$(1),$(subst :, ,$(PATH)))))
259
260 MAKE ?= make
261 MAKE_FULL_PATH = $(call pathsearch, $(MAKE))
262
263 CVS ?= cvs
264 CVS_FULL_PATH = $(call pathsearch,$(CVS))
265
266 ECHO ?= echo
267 ECHO_FULL_PATH = $(call pathsearch,$(ECHO))
268
269 GREP ?= grep
270 GREP_FULL_PATH = $(call pathsearch,$(GREP))
271
272
273 PATCH ?= patch
274 PATCH_FULL_PATH = $(call pathsearch,$(PATCH))
275
276
277
278 jim.wunderlich 1.1
279 # ===============================================================================
280 # Shell internal commands
281 # ===============================================================================
282 CD ?= cd
283
284
285 # ===============================================================================
286 # Area to set defaults
287 # ===============================================================================
288
289
290 ROOT ?= $(subst \,/,$(PEGASUS_ROOT))
291
292 FILE_PATH = $(ROOT)/mak
293
294 FILE_NAME = TaskMakefile
295
296
297 FILE = $(FILE_PATH)/$(FILE_NAME)
298
299 jim.wunderlich 1.1
300 # ===============================================================================
301 # The remaining defaults will be set only if they are not already set.
302 # ===============================================================================
303
304 # MODULE_NAME ?= pegasus
305 MODULE_NAME ?= junk
306
307 ifeq ($(MODULE_NAME),pegasus)
308 BFILE ?= env_var.status
309 else
310 # must be junk module
311 BFILE ?= a.cpp
312 endif
313
314 #
315 # diff and rdiff support different options.
316 # diff supports more options than rdiff does.
317 #
318
319 DIFF_OPTIONS ?=
320 jim.wunderlich 1.1
321 RDIFF_OPTIONS ?=
322
323
324 # ==================================================================================
325 # Rule definitions starts here
326 # ==================================================================================
327
328 .PHONY: FORCE
329
330 # =====================
331 # This rule must be the first in the file so if no make command is specified then
332 # the usage information will be displayed.
333 default: usage
334
335 # =====================
336 # assure that a minimum of commands exist.
337 #
338 # Without ECHO and CVS essentially nothing can be done.
339 exists_minimum: exists_MAKE exists_CVS exists_ECHO
340
341 jim.wunderlich 1.1 # ======================
342 # assure that MAKE exists
343 #
344 exists_MAKE: FORCE
345 ifeq ($(MAKE_FULL_PATH),)
346 $(error MAKE command ($(MAKE)) not found in PATH $(PATH))
347 endif
348
349
350 # ======================
351 # assure that CVS exists
352 #
353 exists_CVS: FORCE
354 ifeq ($(CVS_FULL_PATH),)
355 $(error CVS command ($(CVS)) not found in PATH $(PATH))
356 endif
357
358
359 # ======================
360 # assure that PATCH exists
361 #
362 jim.wunderlich 1.1 exists_PATCH: FORCE
363 ifeq ($(PATCH_FULL_PATH),)
364 $(error PATCH command ($(PATCH)) not found in PATH $(PATH))
365 endif
366
367 # ======================
368 # assure that GREP exists
369 #
370 exists_GREP: FORCE
371 ifeq ($(GREP_FULL_PATH),)
372 $(error GREP command ($(GREP)) not found in PATH $(PATH))
373 endif
374
375 # ======================
376 # assure that ECHO exists
377 #
378 exists_ECHO: FORCE
379 ifeq ($(ECHO_FULL_PATH),)
380 $(error ECHO command ($(ECHO)) not found in PATH $(PATH))
381 endif
382
383 jim.wunderlich 1.1
384
385 # ======================
386 # assure that BNAME exists
387 #
388 exists_BNAME: FORCE
389 ifeq ($(BNAME),)
390 @ $(ECHO)
391 @ $(ECHO) " BNAME not set, set is on the command line. "
392 @ $(ECHO) " IE: $(MAKE) -f $(FILE_NAME) [command] BNAME=PEPX_Y "
393 @ $(ECHO)
394 @ $(MAKE) -f $(FILE) parm_error PARM_MSG="BNAME not set"
395 endif
396
397 # ======================
398 # assure that NEW_BNAME exists
399 #
400 exists_NEW_BNAME: FORCE
401 ifeq ($(NEW_BNAME),)
402 @ $(ECHO)
403 @ $(ECHO) " NEW_BNAME not set, set is on the command line. "
404 jim.wunderlich 1.1 @ $(ECHO) " IE: $(MAKE) -f $(FILE_NAME) [command] NEW_BNAME=PEPX_Y "
405 @ $(ECHO)
406 @ $(MAKE) -f $(FILE) parm_error PARM_MSG="NEW_BNAME not set"
407 endif
408
409 parm_error: FORCE
410 $(error $(PARM_MSG))
411
412
413
414 ## =====================
415 ##
416 ### Function: usage - displays usage information
417 ## Usage: usage
418 ##
419 usage: exists_GREP
420 @ $(GREP) "\#\#\#" $(FILE)
421
422 ## =====================
423 ##
424 ### Function: usage_all - displays usage information
425 jim.wunderlich 1.1 ## Usage: usage_all
426 ##
427 usage_all: exists_GREP
428 @ $(GREP) "\#\#" $(FILE)
429
430 ## =====================
431 ##
432 ### Function: defaults - displays default settings
433 ## Usage: defaults
434 ##
435 defaults: exists_minimum
436 @ $(ECHO) =======================================================================
437 @ $(ECHO)
438 @ $(ECHO) "CVS defaults should be set within the .cvsrc file."
439 @ $(ECHO)
440 @ $(ECHO) --------------------------
441 @ $(ECHO) "Default External Commands used within this Makefile"
442 @ $(ECHO)
443 @ $(ECHO) "CVS = $(CVS)"
444 @ $(ECHO) "CVS_FULL_PATH = $(CVS_FULL_PATH)"
445 @ $(ECHO)
446 jim.wunderlich 1.1 @ $(ECHO) "PATCH = $(PATCH)"
447 @ $(ECHO) "PATCH_FULL_PATH = $(PATCH_FULL_PATH)"
448 @ $(ECHO)
449 @ $(ECHO) "GREP = $(GREP)"
450 @ $(ECHO) "GREP_FULL_PATH = $(GREP_FULL_PATH)"
451 @ $(ECHO)
452 @ $(ECHO) "ECHO = $(ECHO)"
453 @ $(ECHO) "ECHO_FULL_PATH = $(ECHO_FULL_PATH)"
454 @ $(ECHO)
455 @ $(ECHO) --------------------------
456 @ $(ECHO) "Defaults used within this Makefile."
457 @ $(ECHO)
458 @ $(ECHO) "FILE_PATH = $(FILE_PATH)"
459 @ $(ECHO) "FILE_NAME = $(FILE_NAME)"
460 @ $(ECHO)
461 @ $(ECHO) --------------------------
462 @ $(ECHO) "Defaults used within this Makefile that can be overridden from the"
463 @ $(ECHO) " command line."
464 @ $(ECHO)
465 @ $(ECHO) "MODULE_NAME = $(MODULE_NAME)"
466 @ $(ECHO) "BFILE = $(BFILE)"
467 jim.wunderlich 1.1 @ $(ECHO)
468 @ $(ECHO) "DIFF_OPTIONS = $(DIFF_OPTIONS)"
469 @ $(ECHO) "RDIFF_OPTIONS = $(RDIFF_OPTIONS)"
470 @ $(ECHO)
471 @ $(ECHO) "For example"
472 @ $(ECHO) " $(MAKE) -f $(FILE_NAME) branch_checkout BNAME=PEPX_Y MODULE=module"
473 @ $(ECHO)
474 @ $(ECHO) =======================================================================
475
476 ## =====================
477 ##
478 ### Function: branch_list - List branches and other symbolic links
479 ## Usage: branch_list [BFILE=(FILE NAME)]
480 ##
481 ## Note: A log is performed on a chosen file, such as the env_var.status
482 ## file since it has been in the trunk for a while, having most
483 ## symbolic variables assigned to it, and very few revisions.
484 ##
485 branch_list: exists_minimum
486 -$(CVS) rlog $(MODULE_NAME)/$(BFILE) | $(GREP) TASK
487
488 jim.wunderlich 1.1
489 # =====================
490 ##
491 ### Function: branch_status - Show "branch" status
492 ## Usage: branch_status [BFILE=(FILE NAME)]
493 ##
494 ## Note: Must be executed from the directory above $(MODULE_NAME),
495 ## the top of the trunk.
496 ##
497 ## Note: A log is performed on a chosen file, such as the env_var.status
498 ## file since it has been in the trunk for a while, having most
499 ## symbolic variables assigned to it, and very few revisions.
500 ##
501 branch_status: exists_minimum
502 $(CD) $(MODULE_NAME)
503 $(CVS) status $(MODULE_NAME)/$(BFILE)
504
505
506
507 ## =====================
508 ##
509 jim.wunderlich 1.1 ### Function: branch_create - Creates branch and the tags to manage it.
510 ## Usage: branch_create BNAME=(BRANCH NAME)
511 ##
512 ##
513 ## Process:
514 ## Create "root" tag on main branch
515 ## Create "branch" using the "root" tag
516 ## Create a "merged_in_to_trunk" tag for later use in the merge in.
517 ## Create a "merged_out_from_trunk" tag for later use in the merge out.
518 ## Create a "merged_in_from_branch" tag for later use in the merge in.
519 ## Create a "merged_out_to_branch" tag for later use in the merge out.
520 ##
521 ##
522 branch_create: exists_minimum exists_BNAME
523 $(CVS) rtag -f TASK-$(BNAME)-root $(MODULE_NAME)
524 $(CVS) rtag -b -r TASK-$(BNAME)-root TASK-$(BNAME)-branch $(MODULE_NAME)
525 $(CVS) rtag -r TASK-$(BNAME)-root TASK-$(BNAME)-merged_in_to_trunk $(MODULE_NAME)
526 $(CVS) rtag -r TASK-$(BNAME)-root TASK-$(BNAME)-merged_out_from_trunk $(MODULE_NAME)
527 $(CVS) rtag -r TASK-$(BNAME)-branch TASK-$(BNAME)-merged_in_from_branch $(MODULE_NAME)
528 $(CVS) rtag -r TASK-$(BNAME)-branch TASK-$(BNAME)-merged_out_to_branch $(MODULE_NAME)
529
530 jim.wunderlich 1.1
531 ## =====================
532 ##
533 ### Function: branch_rename - Renames existing branch and all the tags to manage it.
534 ## Usage: branch_rename BNAME=(OLD NAME) NEW_BNAME=(NEW NAME)
535 ##
536 ##
537 ## Process:
538 ## Rename TASK-[BNAME]-root to TASK-[NEW_BNAME]-root
539 ## Rename TASK-[BNAME]-branch to TASK-[NEW_BNAME]-branch
540 ## Rename TASK-[BNAME]-merged_in_to_trunk
541 ## to TASK-[NEW_BNAME]-merged_in_to_trunk
542 ## Rename TASK-[BNAME]-merged_out_from_trunk
543 ## to TASK-[NEW_BNAME]-merged_out_from_trunk
544 ## Rename TASK-[BNAME]-merged_in_from_branch
545 ## to TASK-[NEW_BNAME]-merged_in_from_branch
546 ## Rename TASK-[BNAME]-merged_out_to_branch
547 ## to TASK-[NEW_BNAME]-merged_out_to_branch
548 ## Delete Branch TASK-[BNAME]
549 ##
550 branch_rename: exists_minimum exists_BNAME exists_NEW_BNAME
551 jim.wunderlich 1.1 $(CVS) rtag -r TASK-$(BNAME)-root TASK-$(NEW_BNAME)-root $(MODULE_NAME)
552 $(CVS) rtag -b -r TASK-$(BNAME)-branch TASK-$(NEW_BNAME)-branch $(MODULE_NAME)
553 $(CVS) rtag -r TASK-$(BNAME)-merged_in_to_trunk TASK-$(NEW_BNAME)-merged_in_to_trunk $(MODULE_NAME)
554 $(CVS) rtag -r TASK-$(BNAME)-merged_out_from_trunk TASK-$(NEW_BNAME)-merged_out_from_trunk $(MODULE_NAME)
555 $(CVS) rtag -r TASK-$(BNAME)-merged_in_from_branch TASK-$(NEW_BNAME)-merged_in_from_branch $(MODULE_NAME)
556 $(CVS) rtag -r TASK-$(BNAME)-merged_out_to_branch TASK-$(NEW_BNAME)-merged_out_to_branch $(MODULE_NAME)
557 $(MAKE) -f $(FILE) branch_delete BNAME=$(BNAME)
558
559
560 ## =====================
561 ##
562 ### Function: branch_delete - Delete the named branch and its management tags.
563 ## Usage: branch_delete BNAME=(BRANCH NAME)
564 ##
565 ## Process:
566 ## Delete "root" tag
567 ## Delete the "merged_in_to_trunk" tag.
568 ## Delete the "merged_out_from_trunk" tag.
569 ## Delete the "merged_in_from_branch" tag.
570 ## Delete the "merged_out_to_branch" tag.
571 ## Delete the "merging_in_to_trunk" tag.
572 jim.wunderlich 1.1 ## Delete the "merging_out_from_trunk" tag.
573 ## Delete the "merging_in_from_branch" tag.
574 ## Delete the "merging_out_to_branch" tag.
575 ## Delete the branch
576 ##
577 ##
578 branch_delete: exists_minimum exists_BNAME
579 $(CVS) rtag -d TASK-$(BNAME)-root $(MODULE_NAME)
580 $(CVS) rtag -d TASK-$(BNAME)-merged_in_to_trunk $(MODULE_NAME)
581 $(CVS) rtag -d TASK-$(BNAME)-merged_out_from_trunk $(MODULE_NAME)
582 $(CVS) rtag -d TASK-$(BNAME)-merged_in_from_branch $(MODULE_NAME)
583 $(CVS) rtag -d TASK-$(BNAME)-merged_out_to_branch $(MODULE_NAME)
584 $(CVS) rtag -d TASK-$(BNAME)-merging_in_to_trunk $(MODULE_NAME)
585 $(CVS) rtag -d TASK-$(BNAME)-merging_out_from_trunk $(MODULE_NAME)
586 $(CVS) rtag -d TASK-$(BNAME)-merging_in_from_branch $(MODULE_NAME)
587 $(CVS) rtag -d TASK-$(BNAME)-merging_out_to_branch $(MODULE_NAME)
588 $(CVS) rtag -B -d TASK-$(BNAME)-branch $(MODULE_NAME)
589
590 ## =====================
591 ##
592 ### Function: branch_checkout - checks out the head of the branch trunk
593 jim.wunderlich 1.1 ## Aliases: branch_co
594 ## Usage: branch_checkout BNAME=(BRANCH NAME)
595 ## Note: Must be executed from the directory where the top pegasus
596 ## directory shall be placed.
597 ##
598 branch_co branch_checkout: exists_minimum
599 $(CVS) checkout -r TASK-$(BNAME)-branch $(MODULE_NAME)
600
601
602 ## =====================
603 ##
604 ### Function: branch_commit - checks into the head of the branch trunk
605 ## Aliases: branch_ci
606 ## Usage: branch_ci BNAME=(BRANCH NAME)
607 ## Note: Must be executed from within a directory of a working trunk
608 ##
609 branch_ci branch_commit: exists_minimum
610 $(CVS) commit $(MODULE_NAME)
611
612
613 ## =====================
614 jim.wunderlich 1.1 ##
615 ### Function: branch_diff - diffs current working tree to the head of the
616 ### branch tree
617 ## Usage: branch_diff [DIFF_OPTIONS=(OPTIONS)]
618 ## Note: Must be executed from within a directory of a working tree
619 ##
620 branch_diff: exists_minimum
621 $(CVS) diff $(DIFF_OPTIONS) $(MODULE_NAME)
622
623 ## =====================
624 ##
625 ### Function: branch_diff_to_root - diffs branch to its root
626 ## Usage: branch_diff_to_root BNAME=(BRANCH NAME) [RDIFF_OPTIONS=(OPTIONS)]
627 ##
628 branch_diff_to_root: exists_minimum exists_BNAME
629 $(CVS) rdiff $(RDIFF_OPTIONS) -r TASK-$(BNAME)-root -r TASK-$(BNAME)-branch $(MODULE_NAME)
630
631 ## =====================
632 ##
633 ### Function: branch_diff_to_trunk - diffs branch head to the head of the trunk
634 ## Usage: branch_diff_to_trunk BNAME=(BRANCH NAME) [RDIFF_OPTIONS=(OPTIONS)]
635 jim.wunderlich 1.1 ##
636 branch_diff_to_trunk: exists_minimum exists_BNAME
637 $(CVS) rdiff $(RDIFF_OPTIONS) -r TASK-$(BNAME)-branch $(MODULE_NAME)
638
639 ## =====================
640 ##
641 ### Function: branch_diff_unmerged_branch - shows all changes on the
642 ### branch since the last merge in.
643 ## Usage: branch_diff_unmerged_branch BNAME=(BRANCH NAME) [RDIFF_OPTIONS=(OPTIONS)]
644 ##
645 branch_diff_unmerged_branch: exists_minimum exists_BNAME
646 $(CVS) rdiff $(RDIFF_OPTIONS) -r TASK-$(BNAME)-merged_in_from_branch -r TASK-$(BNAME)-branch $(MODULE_NAME)
647
648
649 ## =====================
650 ##
651 ### Function: branch_diff_unmerged_trunk - shows all changes on the
652 ### trunk since the last merge out
653 ## Usage: branch_diff_unmerged_trunk BNAME=(BRANCH NAME) [RDIFF_OPTIONS=(OPTIONS)]
654 ##
655 branch_diff_unmerged_trunk: exists_minimum exists_BNAME
656 jim.wunderlich 1.1 $(CVS) rdiff $(RDIFF_OPTIONS) -r TASK-$(BNAME)-merged_out_from_trunk $(MODULE_NAME)
657
658
659 ## =====================
660 ##
661 ### Function: branch_merge_in - starts the two part process to merge
662 ### the changes in the branch into the trunk.
663 ## Usage: branch_merge_in BNAME=(BRANCH NAME)
664 ##
665 ## Note: Must be executed from the directory where the top pegasus
666 ## directory shall be placed when the checkout is performed
667 ## to instantiate the working copy of the trunk within which
668 ## the merge will be performed
669 ##
670 ## Process:
671 ##
672 ## branch_merge_in BNAME=(BRANCH NAME)
673 ## - Tag main trunk with the merging_in_to_trunk tag.
674 ## - Tag branch with the merging_in_from_branch tag.
675 ## - Checkout the trunk head into a working copy of the trunk.
676 ## NOTE: The merging_in tag is not used because that
677 jim.wunderlich 1.1 ## would result in a sticky tag that will preclude the
678 ## subsequent commit of the merged files. The
679 ## merging_in tag is created because if any other commits
680 ## occur while the merge is in process they will be detected
681 ## and merged on the subsequent merge_in. It is safer to
682 ## do this than to risk the chance of missing a commit.
683 ## - Use update to merge in the branch changes since last the merge_in.
684 ## - Manually resolve any conflicts in the working copy of the trunk.
685 ##
686 ## branch_merge_in_commit BNAME=(BRANCH NAME)
687 ## - Check in merged changes from the working copy of the trunk into the
688 ## main branch.
689 ##
690 ## branch_merge_in_finish BNAME=(BRANCH NAME)
691 ## - Move the merged_in_to_trunk tag to the merging_in_to_trunk tag
692 ## - Move the merged_in_from_branch tag to
693 ## the merging_in_from_branch tag
694 ## - Delete the TASK-$(BNAME)-merging_in_to_trunk tag
695 ## - Delete the TASK-$(BNAME)-merging_in_from_branch tag
696 ##
697 ##
698 jim.wunderlich 1.1 branch_merge_in: exists_minimum exists_BNAME
699 $(CVS) rtag -F TASK-$(BNAME)-merging_in_to_trunk $(MODULE_NAME)
700 $(CVS) rtag -F -r TASK-$(BNAME)-branch TASK-$(BNAME)-merging_in_from_branch $(MODULE_NAME)
701 $(CVS) checkout -P $(MODULE_NAME)
702 $(CD) $(MODULE_NAME)
703 $(CVS) update -P -d -j TASK-$(BNAME)-merged_in_from_branch -j TASK-$(BNAME)-merging_in_from_branch $(MODULE_NAME)
704 @ $(ECHO)
705 @ $(ECHO) Differences from branch now merged into
706 @ $(ECHO) the local working copy of the trunk.
707 @ $(ECHO)
708 @ $(ECHO) Now manually:
709 @ $(ECHO) 1. Resolve any merge conflicts.
710 @ $(ECHO) 2. Review differences to assure commit integrity.
711 @ $(ECHO) That is don't check in unintended white space changes
712 @ $(ECHO) test or debug code.
713 @ $(ECHO) 3. Check for aded files and directories and do a cvs add
714 @ $(ECHO) command for them.
715 @ $(ECHO)
716 @ $(ECHO) Then check in the files. Either manually or by using
717 @ $(ECHO) " $(MAKE) -f $(FILE_NAME) branch_merge_in_ci BNAME=$(BNAME)"
718 @ $(ECHO) within the $(MODULE_NAME) directory.
719 jim.wunderlich 1.1 @ $(ECHO)
720 @ $(ECHO) If you chose to do a manual commit then after the commit
721 @ $(ECHO) is complete then do a:
722 @ $(ECHO) " $(MAKE) -f $(FILE_NAME) branch_merge_in_finish BNAME=$(BNAME)"
723 @ $(ECHO) within the $(MODULE_NAME) directory to reset the appropriate
724 @ $(ECHO) branch management tags.
725 @ $(ECHO)
726 @ $(ECHO)
727
728
729 branch_merge_in_ci branch_merge_in_commit: exists_minimum exists_BNAME
730 $(CD) $(MODULE_NAME)
731 $(CVS) commit
732 @ $(ECHO)
733 @ $(ECHO) Check in of merged files from branch into trunk complete.
734 @ $(ECHO)
735 $(MAKE) -f $(FILE) branch_merge_in_finish BNAME=$(BNAME)
736
737
738 branch_merge_in_finish: exists_minimum exists_BNAME
739 $(CVS) rtag -F -r TASK-$(BNAME)-merging_in_to_trunk TASK-$(BNAME)-merged_in_to_trunk $(MODULE_NAME)
740 jim.wunderlich 1.1 $(CVS) rtag -F -r TASK-$(BNAME)-merging_in_from_branch TASK-$(BNAME)-merged_in_from_branch $(MODULE_NAME)
741 $(CVS) rtag -d TASK-$(BNAME)-merging_in_to_trunk $(MODULE_NAME)
742 $(CVS) rtag -d TASK-$(BNAME)-merging_in_from_branch $(MODULE_NAME)
743 @ $(ECHO)
744 @ $(ECHO) Branch Management tags have now been updated to reflect the new branch status.
745 @ $(ECHO)
746
747
748
749 ## =====================
750 ###
751 ### Function: branch_merge_out - starts the two part process to merge
752 ### the changes in the trunk into the branch.
753 ## Usage: branch_merge_out BNAME=(BRANCH NAME)
754 ##
755 ## Note: Must be executed from the directory where the top pegasus
756 ## directory shall be placed when the checkout is performed
757 ## to instantiate the working copy of the trunk within which
758 ## the merge will be performed
759 ##
760 ## Process:
761 jim.wunderlich 1.1 ##
762 ## branch_merge_out BNAME=(BRANCH NAME)
763 ## - Tag main trunk with the merging_out_from_trunk tag.
764 ## - Tag branch with the merging_out_to_branch tag.
765 ## - Checkout the trunk head into a working copy of the trunk.
766 ## NOTE: The merging_out tag is not used because that
767 ## would result in a Sticky tag that will preclude the
768 ## subsequent commit of the merged files. The
769 ## mergeing_out tag is created because if any other commits
770 ## occur while the merge is in process they will be detected
771 ## and merged on the subsequent merge_out. It is safer to
772 ## do this than to risk the chance of missing a commit.
773 ## - Use update to merge in the trunk changes since last the merge_out.
774 ## - Manually resolve any conflicts in the working copy of the trunk.
775 ##
776 ## branch_merge_out_commit BNAME=(BRANCH NAME)
777 ## - Check in merged changes from the working copy of the trunk into the
778 ## branch.
779 ##
780 ## branch_merge_out_finish BNAME=(BRANCH NAME)
781 ## - Move the merged_out_from_trunk tag to the merging_out_from_trunk tag
782 jim.wunderlich 1.1 ## - Move the merged_out_to_branch tag to
783 ## the merging_out_to_branch tag
784 ## - Delete the TASK-$(BNAME)-merging_out_from_trunk tag
785 ## - Delete the TASK-$(BNAME)-merging_out_to_branch tag
786 ##
787 ##
788 ##
789 ##
790 branch_merge_out: exists_minimum exists_BNAME
791 $(CVS) rtag -F TASK-$(BNAME)-merging_out_from_trunk $(MODULE_NAME)
792 $(CVS) rtag -F -r TASK-$(BNAME)-branch TASK-$(BNAME)-merging_out_to_branch $(MODULE_NAME)
793 $(CVS) checkout -P -r TASK-$(BNAME)-branch $(MODULE_NAME)
794 $(CD) $(MODULE_NAME)
795 $(CVS) update -d -j TASK-$(BNAME)-merged_out_from_trunk -j TASK-$(BNAME)-merging_out_from_trunk
796 @ $(ECHO)
797 @ $(ECHO) Differences from trunk now merged into
798 @ $(ECHO) the local working copy of the branch.
799 @ $(ECHO)
800 @ $(ECHO) Now manually:
801 @ $(ECHO) 1. Resolve any merge conflicts.
802 @ $(ECHO) 2. Check for added files and directories and do a cvs add
803 jim.wunderlich 1.1 @ $(ECHO) command for them.
804 @ $(ECHO)
805 @ $(ECHO) Then check in the files. Either manually or by using
806 @ $(ECHO) " $(MAKE) -f $(FILE_NAME) branch_merge_out_ci BNAME=$(BNAME)"
807 @ $(ECHO) within the $(MODULE_NAME) directory.
808 @ $(ECHO)
809 @ $(ECHO) If you chose to do a manual commit then after the commit
810 @ $(ECHO) is complete do a:
811 @ $(ECHO) " $(MAKE) -f $(FILE_NAME) branch_merge_out_finish BNAME=$(BNAME)"
812 @ $(ECHO) within the $(MODULE_NAME) directory to reset the appropriate
813 @ $(ECHO) branch management tags.
814 @ $(ECHO)
815 @ $(ECHO)
816
817 branch_merge_out_ci branch_merge_out_commit: exists_minimum exists_BNAME
818 $(CD) $(MODULE_NAME)
819 $(CVS) commit
820 @ $(ECHO)
821 @ $(ECHO) Check in of merged files from trunk into branch is complete.
822 @ $(ECHO)
823 $(MAKE) -f $(FILE) branch_merge_out_finish BNAME=$(BNAME)
824 jim.wunderlich 1.1
825 branch_merge_out_finish: exists_minimum exists_BNAME
826 $(CVS) rtag -F -r TASK-$(BNAME)-merging_out_from_trunk TASK-$(BNAME)-merged_out_from_trunk $(MODULE_NAME)
827 $(CVS) rtag -F -r TASK-$(BNAME)-merging_out_to_branch TASK-$(BNAME)-merged_out_to_branch $(MODULE_NAME)
828 $(CVS) rtag -d TASK-$(BNAME)-merging_out_from_trunk $(MODULE_NAME)
829 $(CVS) rtag -d TASK-$(BNAME)-merging_out_to_branch $(MODULE_NAME)
830 @ $(ECHO)
831 @ $(ECHO) Branch Management tags have now been updated to reflect the new branch status.
832 @ $(ECHO)
833
834
835
836
837 ## =====================
838 ###
839 ### Function: branch_migrate - starts the process to migrate the
840 ### branch to the HEAD of the trunk.
841 ###
842 ## Usage: branch_migrate BNAME=(BRANCH NAME)
843 ##
844 ## Note: Must be executed from the directory where the top pegasus
845 jim.wunderlich 1.1 ## directory shall be placed when the checkout is performed
846 ## to instantiate the working copy of the trunk within which
847 ## the merge will be performed
848 ##
849 ## Process:
850 ##
851 ## branch_migrate BNAME=(BRANCH NAME)
852 ## - get diffs of unmerged_changes_branch into a local patch_diff file.
853 ## - create the new branch to migrate to.
854 ## - Checkout the new branch
855 ## - Apply the patch_diff file to the working trunk
856 ## - Manually resolve any merge conflicts in the working trunk.
857 ##
858 ## branch_migrate_commit BNAME=(BRANCH NAME)
859 ## - Commit the changes into the new branch
860 ##
861 ## EITHER
862 ## branch_migrate_finish BNAME=(BRANCH NAME)
863 ## - Remove the old branch.
864 ## - Rename all branch tags
865 ##
866 jim.wunderlich 1.1 ## OR
867 ## branch_rename BNAME=(BRANCH_NAME)_new NEW_BNAME=(BRANCH NAME)_X
868 ##
869 ##
870 branch_migrate: exists_minimum exists_BNAME
871 $(MAKE) -f $(FILE) branch_diff_unmerged_branch BNAME=$(BNAME) 1>branch_migrate_diffs
872 $(MAKE) -f $(FILE) branch_create BNAME=$(BNAME)_new
873 $(CVS) checkout -P -r TASK-$(BNAME)_new-branch $(MODULE_NAME)
874 $(PATCH) -b -p0 --global-reject-file=global-reject-patch-file < branch_migrate_diffs
875 @ $(ECHO)
876 @ $(ECHO)
877 @ $(ECHO) Differences from previous branch are now merged into
878 @ $(ECHO) the local working copy of the new branch.
879 @ $(ECHO)
880 @ $(ECHO) Now manually:
881 @ $(ECHO) 1. Resolve any merge conflicts.
882 @ $(ECHO) Check the global-patch-reject file in this directory.
883 @ $(ECHO) If it does not exist then there were no patch errors.
884 @ $(ECHO) 2. Check for added files and directories and do a cvs add
885 @ $(ECHO) command for them prior to the commit..
886 @ $(ECHO)
887 jim.wunderlich 1.1 @ $(ECHO) Then check in the files. Either manually or by using
888 @ $(ECHO) " $(MAKE) -f $(FILE_NAME) branch_migrate_ci BNAME=$(BNAME)"
889 @ $(ECHO) within the $(MODULE_NAME) directory.
890 @ $(ECHO)
891 @ $(ECHO) If you chose to do a manual commit then after the commit
892 @ $(ECHO) is complete then do a
893 @ $(ECHO) "$(MAKE) -f $(FILE_NAME) branch_migrate_finish BNAME=$(BNAME)"
894 @ $(ECHO) within the $(MODULE_NAME) directory to reset the appropriate
895 @ $(ECHO) branch management tags.
896 @ $(ECHO)
897 @ $(ECHO) If you wish to start this process over then do a
898 @ $(ECHO) " $(MAKE) -f $(FILE_NAME) branch_delete BNAME=$(BNAME)_new"
899 @ $(ECHO) to remove the new branch that was created as the migration
900 @ $(ECHO) target.
901 @ $(ECHO)
902
903 branch_migrate_ci branch_migrate_commit: exists_minimum exists_BNAME
904 $(CD) $(MODULE_NAME)
905 $(CVS) commit
906 @ $(ECHO)
907 @ $(ECHO) Check in of merged files from previous branch into
908 jim.wunderlich 1.1 @ $(ECHO) new branch is complete.
909 @ $(ECHO)
910 $(CD) ..
911 $(MAKE) -f $(FILE) branch_diff_to_root BNAME=$(BNAME) > diff_to_root_$(BNAME)
912 $(MAKE) -f $(FILE) branch_diff_to_root BNAME=$(BNAME)_new > diff_to_root_$(BNAME)_new
913 @ $(ECHO) Do a
914 @ $(ECHO) " diff diff_to_root_$(BNAME) diff_to_root_$(BNAME)_new"
915 @ $(ECHO) to verify TASK-$(BNAME)_new has all the changes.
916 @ $(ECHO)
917 @ $(ECHO) Then do a
918 @ $(ECHO) " $(MAKE) -f $(FILE_NAME) branch_migrate_finish BNAME=$(BNAME)"
919 @ $(ECHO) which will remove TASK-$(BNAME), the old branch, and then rename TASK-$(BNAME)_new to TASK-$(BNAME)
920 @ $(ECHO) Alternatively you can keep the old branch around for a while and just
921 @ $(ECHO) rename the new branch by doing a
922 @ $(ECHO) " $(MAKE) -f $(FILE_NAME) branch_rename BNAME=$(BNAME)_new NEW_BNAME=($BNAME)_X"
923 @ $(ECHO) where X is something you chose to identify the new branch.
924
925
926 branch_migrate_finish: exists_minimum exists_BNAME
927 $(MAKE) -f $(FILE) branch_delete BNAME=$(BNAME)
928 $(MAKE) -f $(FILE) branch_rename BNAME=$(BNAME)_new NEW_BNAME=$(BNAME)
929 jim.wunderlich 1.1 @ $(ECHO)
930 @ $(ECHO) Branch Management tags have now been updated to reflect the new branch status.
931 @ $(ECHO)
932
933
934
935
|