Fossil

Check-in [e5ac794f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor coding style change.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | offline-sync
Files: files | file ages | folders
SHA3-256:e5ac794f28c1577877d456a5bc6304a911754774b9d7f3f2be83e205b6d72c09
User & Date: mistachkin 2019-05-17 18:55:11
Context
2019-05-17
19:07
When attempting to determine the Fossil user information, do not smash the global URL information which may contain an alternate URL used for sync operations (e.g. when using 'fossil sync --once'). This fixes the ability to work offline and synchronize with a USB thumbdrive ala sneaker-net. check-in: b9e36291 user: mistachkin tags: trunk
18:55
Minor coding style change. Closed-Leaf check-in: e5ac794f user: mistachkin tags: offline-sync
18:54
Merge updates from trunk. check-in: be8b227b user: mistachkin tags: offline-sync
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/user.c.

506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525

526
527
528
529
530
531
532
    if( attempt_user(g.zLogin)==0 ){
      fossil_fatal("no such user: %s", g.zLogin);
    }else{
      return;
    }
  }

  memset(&url, 0, sizeof(url));
  if( g.localOpen && attempt_user(db_lget("default-user",0)) ) return;

  if( attempt_user(db_get("default-user", 0)) ) return;

  if( attempt_user(fossil_getenv("FOSSIL_USER")) ) return;

  if( attempt_user(fossil_getenv("USER")) ) return;

  if( attempt_user(fossil_getenv("LOGNAME")) ) return;

  if( attempt_user(fossil_getenv("USERNAME")) ) return;


  url_parse_local(0, 0, &url);
  if( url.user && attempt_user(url.user) ) return;

  fossil_print(
    "Cannot figure out who you are!  Consider using the --user\n"
    "command line option, setting your USER environment variable,\n"
    "or setting a default user with \"fossil user default USER\".\n"







<












>







506
507
508
509
510
511
512

513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
    if( attempt_user(g.zLogin)==0 ){
      fossil_fatal("no such user: %s", g.zLogin);
    }else{
      return;
    }
  }


  if( g.localOpen && attempt_user(db_lget("default-user",0)) ) return;

  if( attempt_user(db_get("default-user", 0)) ) return;

  if( attempt_user(fossil_getenv("FOSSIL_USER")) ) return;

  if( attempt_user(fossil_getenv("USER")) ) return;

  if( attempt_user(fossil_getenv("LOGNAME")) ) return;

  if( attempt_user(fossil_getenv("USERNAME")) ) return;

  memset(&url, 0, sizeof(url));
  url_parse_local(0, 0, &url);
  if( url.user && attempt_user(url.user) ) return;

  fossil_print(
    "Cannot figure out who you are!  Consider using the --user\n"
    "command line option, setting your USER environment variable,\n"
    "or setting a default user with \"fossil user default USER\".\n"