# # # patch "ChangeLog" # from [0963ea40da90391247b3ad96104271f6aa11e3aa] # to [cd217b8121603c18f4e5adab885cda69e092c2fa] # # patch "cmd_netsync.cc" # from [185ba65be2f13ea6a4dbd6ffcc0c43f99dc46269] # to [ee049ceb9c49159c22730c45558e7cee46845741] # ============================================================ --- ChangeLog 0963ea40da90391247b3ad96104271f6aa11e3aa +++ ChangeLog cd217b8121603c18f4e5adab885cda69e092c2fa @@ -1,3 +1,7 @@ +2006-10-05 Alex Queiroz + + * cmd_netsync.cc: First draft of a "clone" command. + 2006-10-04 Timothy Brownawell * automate.cc: Fix automate inventory. ============================================================ --- cmd_netsync.cc 185ba65be2f13ea6a4dbd6ffcc0c43f99dc46269 +++ cmd_netsync.cc ee049ceb9c49159c22730c45558e7cee46845741 @@ -113,6 +113,25 @@ process_netsync_args(string const & name } } +CMD_NO_WORKSPACE(clone, N_("network"), N_("[ADDRESS[:PORTNUMBER] [PATTERN]]"), + N_("initializes a new database and pull branches matching PATTERN from server at ADDRESS"), + option::exclude % option::set_default) +{ + // not using defaults because it's a new db + utf8 addr, include_pattern, exclude_pattern; + process_netsync_args(name, args, addr, include_pattern, exclude_pattern, + false, false, false, app); + + // args ok, initialize new database + app.db.initialize(); + + if (app.signing_key() == "") + P(F("doing anonymous pull; use -kKEYNAME if you need authentication")); + + run_netsync_protocol(client_voice, sink_role, addr, + include_pattern, exclude_pattern, app); +} + CMD(push, N_("network"), N_("[ADDRESS[:PORTNUMBER] [PATTERN]]"), N_("push branches matching PATTERN to netsync server at ADDRESS"), option::set_default % option::exclude % option::key_to_push)